The 23-year-old was crossing the tracks on a line between Munich and Karlsfeld on Saturday afternoon with a friend when they noticed a regional train approaching, the police report states.
In an apparent show of daring to his mate, the young man lay down on the tracks in front of the fast-approaching locomotive.
The driver saw the young man lying on the track and pulled the emergency brake. But he was too close to stop in time and the train rolled straight over the top of him.
When the train finally came to a stop, the driver exited his cabin, no doubt fearing the worst. But instead he arrived at the back of the vehicle to find the young man standing next to the tracks chatting with his friend.
It was then that it became apparent that the young man had managed to position himself on the track in such a way that the train did not touch him.
But the driver failed to see the funny side and took the two youths to Munich station where he handed them to federal police officers.
Police described the act as "life-threatening foolishness that only works in Wild West films."
"Depending on the train's speed and the strength of the suction, the design of the train or simply the person's stature, this kind of experiment can lead to life-threatening injuries," the report states.
According to the Süddeutsche Zeitung, the young man now faces a jail sentence of between three months and five years for a serious act of danger on public transport.