Identified by the Bild newspaper as 19-year-old Valerian V., the German Studies student had managed to get on the roof of an S-Bahn carriage with four friends, and rode down the tracks for about a kilometre.
For the most part, the S-Bahn network runs overground – occasionally going under bridges or through longer tunnels.
“Surfing” on top of a carriage is, police said, “morbidly reckless”.
As the train on the S1 line headed under a low bridge in the Schöneberg area of the city, Valerian V. was knocked off.
There was just a 30-centimetre gap between the train and the bridge, Tagesspiegel newspaper reported.
Police believe that he could have panicked and forgotten to duck down.
His friends managed to pass under the bridge unharmed and waited until the next stop - Julius-Leber-Brücke in Schöneberg - to jump off and call the police.
Paramedics arrived but it was too late for the teenager, who was lying next to the track, fatally injured.
Police said there was nothing to suggest he or his friends were drunk or on drugs.
Officers took the four men in for questioning and they now face charges of trespassing.
Exactly how the five men got onto the roof of a train is unclear.
SEE ALSO: Berlin woman killed by her own car