A major clear-up operation is under way after torrential rain caused severe disruption to commuters.
The main rail line from Edinburgh to Glasgow was shut after flooding at Winchburgh tunnel in West Lothian resulted in passengers on five trains being trapped for several hours.
ScotRail said water was sitting two feet above the rails and there was no timescale for the tunnel reopening.
The issue is continuing to affect rail services across the central belt.
ScotRail said engineers had been working through the night to pump water from the tunnel following the deluge on Wednesday.
Rail passengers travelling between Glasgow and Edinburgh are being advised to make alternative arrangements for travel and to check ahead before setting off on journeys.
Suz Scott was among passengers stuck on one of the five trains stranded in floodwater outside Linlithgow.
She told the BBC Scotland website that there was an announcement that there was too much water ahead and behind the train to continue their journey.
“Then we saw this deluge of water start to submerge the tracks,” she said.
The “poor train staff” were trying to find a solution to the problem but did not seem to have a “plan B”, she added.
The rail firm later tweeted to say the Glasgow-bound stranded trains would return to Edinburgh due to the depth of the water in the Winchburgh tunnel.
Replacement bus services have been put in place between Linlithgow and Falkirk Grahamston to Edinburgh Park.
The heavy rain also caused problems around Edinburgh Airport on Wednesday evening, with access roads flooded and cars stuck in floodwater.
Cars and buses were unable to access the airport for a time after the approach road from the M8 motorway came under several feet of water.
A man was spotted cycling through flood water at a roundabout just off Eastfield Road, as the deluge left vehicles on the road partially submerged.
Meanwhile, police in Fife warned motorists to take care as water levels reached up to car bonnets on Admiralty Road, Dunfermline.
A spokesperson posted on social media: “Some serious rain out there causing widespread flooding and awful driving conditions across the south west Fife area.
“Please drive with care, switch your lights on and leave a large gap between the vehicle in front.”
The Met Office has issued a yellow warning for further heavy rain and thunder storms for much of the UK on Friday.