Railway tracks aren't always straight. Only a slight bend, with trackside vegetation (or other visual obstructions) can limit the distance which can be seen.
If you can see a quarter of a mile along the track, a 100mph train (which is just coming into view) will arrive in 9 seconds. (A 125mph train will arrive in 7.2 seconds). If the train is approaching on the track nearest to you, that probably gives you time to get across the track before the train arrives. However people sometimes fail to realise that it's hard to get across BOTH tracks before the train arrives. So, if it's on the furthest track, they end up getting struck by the train.
It's also worth remembering that you don't only need to get clear of the train itself. You also need to get clear of the fast-moving volume of air alongside it, which can drag you under the train.
Chris