Trains are at a standstill on the east coast main line after serious damage to overhead power lines in East Lothian.
Disruption is expected to continue until 11pm.
Network Rail said "significant repairs" would be required after wires came down over one of the two tracks near Wallyford.
It is not clear if the 25,000-volt wires were brought down by a train becoming entangled in them.
Trains affected include Virgin Trains East Coast (Vtec) and CrossCountry cross-Border services and ScotRail services between Dunbar, North Berwick and Edinburgh.
Vtec advised Scotland-London passengers to use the west coast main instead.
ScotRail told passengers: "Due to damage to the overhead electric wires at Wallyford, the line is closed.
"Disruption is expected until 11pm.
"Our staff are on route to the trapped train between Prestonpans and Longniddry with water and we are putting a plan in place to have you on the move."
Coaches have been laid on to replace some other ScotRail services, while passengers can also use train tickets on Lothian Buses and Perryman's services.
However, the train operator tweeted: "Due to the overhead wire problems at Wallyford, we are struggling to get replacement buses in place but we will keep trying."
A spokesman for the ScotRail Alliance with Network Rail said: "Services are currently suspended between Edinburgh, North Berwick and Dunbar.
"While engineers assess the wires and prepare to fix the damage, single line working is in place to keep other customers moving.
"We’re doing all we can to keep customers moving this evening.
"We have arrangements in place for train tickets to be accepted on local buses, as well as replacement buses in place.
“Anyone delayed over 30 minutes should keep hold of their tickets, and claim compensation under our Delay Repay scheme.”