The engineering train became uncoupled as it was towed on the Northern Line near Archway station.
Work was being carried out by Tube Lines when the accident happened.
The train was eventually stopped at Warren Street and the incident caused huge delays on the underground this morning.
London Underground said the engineering train, which was undertaking rail maintenance work, became defective as it approached Archway, in north London, at about 0525 BST, travelling southbound on the High Barnet branch of the Northern Line.
RMT Assistant General Secretary Pat Sikorski said: “RMT is appalled and horrified at the major incident that occurred this morning during passenger traffic hours and which could have very easily resulted in disaster.
“The runaway train, which it is suspected broke loose from a failed emergency coupling as a broken down grinder unit was being pulled northwards at 6.40 am this morning, represents a safety failure of the highest order.
“We understand that a collision with a passenger service train leaving Archway was only narrowly avoided.
“The overnight works were the responsibility of TfL subsidiary Tube Lines, managed by the private company Amey, and RMT are seeking urgent answers as to whether or not third party contractors were involved in this incident – particularly as the findings from Potters Bar ruled that third party contractors should not be involved in rail maintenance works.
“This horrific failure comes against a background of a systematic reduction in safety-critical jobs and safety procedures as a direct result of TfL’s financial cuts programme. In the light of this morning’s events it is essential that TfL call a halt to their cuts plans and bring an end to the dilution of tube safety.”