David Whitley, 19, caused more than pounds 12,000 damage to seven coaches on the empty train as it was being moved between stations across the country, Oxford Crown Court heard.
In an act of 'vandalism on an epic scale', he wrecked lavatories, windows, doors, seats and tables, Gerard Quirke, for the prosecution, said.
Whitley, a tourism and geography student at Oxford Brookes University, admitted four charges of damaging British Rail property, obstructing a train and stealing food from the buffet. He was ordered to do 200 hours community service.
The court was told Whitley was a member of the Class 47 Society - enthusiasts who travel in as many trains pulled by type-47 engines as they can. On 7 February he went from Manchester to Southampton with a one-way ticket.
He stowed away on the empty train as it was being moved to Derby, intending to get off in Oxford - but it was not scheduled to stop. When he realised it was not stopping, Whitley panicked, got into the guard's van and operated the brake. As the train halted, the driver saw a man get off and the damage was discovered.
When police later identified the man as Whitley, he told them: 'I just flipped.'
The court was told a psychiatrist found Whitley suffered from a disorder that made him live in a state of enslavement, unable to relate to others.
Judge Charles Harris, sentencing, said Whitley had turned violently upon 'an object of his affection'.