The havoc was caused after an engineering train, carrying rails the length of five wagons, came off the track between Broughty Ferry and Dundee at about 2:20am as it travelled into a worksite. No-one was injured.
The incident, less than a mile north of Dundee train station, resulted in services from Glasgow and Edinburgh to Aberdeen terminating at Dundee.
Trains from Aberdeen to Edinburgh and Glasgow terminated at Carnoustie. A number of trains from Glasgow and Edinburgh to Inverness were also affected.
ScotRail said the disruption would continue until Thursday morning.
Earlier yesterday, hundreds of passengers waited outside Dundee railway station for replacement buses provided by ScotRail. The buses ran between Dundee and Carnoustie in both directions to connect with trains. Buses also operated from Dundee to Aberdeen when required.
Staff told commuters at Carnoustie they would be bussed up to Arbroath to get them out of the cold and into a station where they would be able to wait indoors with toilet and cafe facilities.
Chloe Thomson, from Glasgow, said the delay could make her late for work.
“I’ve been waiting 15-20 minutes for a bus because the first one that came was going direct to Aberdeen and it took 57 people, but there wasn’t enough room for everybody. I’m now waiting for the next bus.”
Lee Williamson, 40, a bar worker from Fintry, near Stirling, was worried about getting to Aberdeen airport in time for a flight.
“My flight to Shetland is at 11am, so we might not get there in time. If not, we’ll have to get the ferry.”
Engineers were working on site yesterday to get the train and wagons back on the rails, and will then repair the damage to the tracks.
A spokeswoman for ScotRail Alliance said: “We are really sorry for the inconvenience this will cause our customers. We’re working as hard as we can to reopen the line and resume normal service.”