Be sensible where you go, don't draw too much attention and you'll have no problem 99.9% of the time in Europe.
Very good advice, and my philosophy too. Basically be aware of your surroundings and feel the 'vibes' - if you don't feel comfortable then move on somewhere else.
One problem is that there is no general fencing of railways in many countries, so it's sometimes hard to work out if you are standing on the 'platform', trespassing on the railway or just standing on public property next to it.
...and if a staff member/official does wander over to you (it's happened to me a couple of times on passenger stations in the USA), a friendly smile and saying 'Hello/Hi/Bonjour' etc. helps to break the ice - 9 times out of 10 they just want to make sure you're not on the wrong platform, about to throw yourself under a train, or hopelessly drunk etc. As for the other 10%, you might find they actually want to chat about trains or practise their English on you
--- old post above --- --- new post below ---
As a complete aside, I sincerely hope no-one on this forum is ever as unaware and/or stupid as the idiot in the black jacket (with the hood up) in this video -
http://www.youtube.com/watch?v=FwO-IWorGv4 - even after being bodily moved out of the way of the train at the last second, they carry on filming like nothing had happened !! unbelievable !!
(and that whole crowd is almost certainly trespassing on the railway - it's Union Pacific railroad property in Cheyenne, Wyoming, and that's a 5000+ ton double-stack freight bearing down on them....)