London Underground, Tube Lines Ltd and Schweerbau GMBH had pleaded guilty to endangering passengers and staff under Health and Safety law, after the 39-tonne maintenance wagon hurtled through seven stations before it could be stopped.
A train in front of it was told to keep going and not stop, while its passengers were told to run to the front carriages, the Old Bailey heard.
Judge Richard Hone said: "There was the potential of terrible tragedy."
He said the runaway train was out of control for four miles during 16 minutes.
"To those involved it must have seemed an extremely frightening eternity," he added.
More top news
A Labour MP tipped as a possible candidate for London mayor has admitted crashing into a motorcylist her second accident in just over a year
The 48-year-old man was held on suspicion of theft from heritage and protected sites.
A Met Police officer was left red-faced after attempting to stop a cyclist riding along a dedicated cycle path.