A lot of the problems are due to the
ambiguity in the way the various laws apply,
and a lack of clarity in the way these are explained to the public, the security guards and police officers.
This is not the security guards fault; they were probably instructed to 'watch out for suspicious activity',
without a clear definition of what constitutes 'suspicious activity'.
One way to solve this might be for the local authorities to make a public statement to the effect that
"Photography is legal and accepted behavior in public places; unless there are clearly displayed signs
that prohibit it".
The important part of that is "the clearly displayed signs" bit.
If the owners of a building or transport system don't want people to take photographs, then they must
display signs that indicate that photography is prohibited.
Without clearly displayed signs stating that photography is prohibited,
then threatening arrest for taking photographs would automatically be considered as harassment and unlawful arrest.
We might see an outbreak of 'photography prohibited' signs almost everywhere,
but at least it makes it clear where we stand.
However, I suspect that there are many places where the owners or authorities are happy for their security personnel to
discourage photography on an individual basis, but would balk at the idea of stating their policy in public.
Requiring them to state the ban publicly, with permanent signs, may make them re-asses their policy.
"Is the potential threat really worth the cost of putting up all the signs, damaging our public relations and intimidating our passengers / visitors ?"
Once it is clear what places do prohibit photography, then if we (the public) are unhappy with the prohibition
or feel that it is unnecessary at that location, we can petition the owners or responsible authorities to remove the ban (small print in the law could require that the sign clearly state who is responsible for the ban).
We do the same for parking in big cities.
The penalty in London for parking your car where you are not allowed to is being wheel clamped or towed away.
But, in order for this to be legal, there must be clearly displayed signs that state that parking is prohibited
at that location and what the penalty is.
At least this might help to clear up the current confusion.