They climb up the bit between the carriage ends when a train is in the station as people are boarding/disembarking. Often it isn't noticed. They then sit or stand on the roof bit and dare each other to do stunts as the trains are moving along.... and that's how the accidents happen.
If a train driver becomes alerted to this during a journey (normally by radio from another passing service) the driver of the train with the 'surfers' has to to slow to a stop wherever they are on the network, even if it's in the inner lines of a four-track.
Many drivers will attempt if at all possible to stop in a station but this isn't always possible, and if they stop in the middle of nowhere (like this one did - then the 'surfers' effectively cannot get down, as it's effectively a 4metre drop to the ground from the top of a train without a platform to land on (same as jumping out of your upstairs window) - so they end up marooned on the roof until the emergency services get there - like this chap.
