Emergency services were called just after 3.25pm on Thursday after a 15ft sailing boat capsized and two people were left relying on their lifejackets to stay afloat in the river for around an hour.
An eagle-eyed train driver spotted the pair, who were in the river off Cardross, Argyll and Bute, and shouting for help, and brought his train to a halt.
Mark Ilderton, ScotRail’s head of drivers, said: “Who knows what the consequences could have been for the two people had our driver not stopped to assist.”
Coastguard crews from Greenock and Helensburgh, as well as the lifeboat at Helensburgh, were scrambled to the scene and rescued the pair.
Mr Ilderton said ScotRail staff are “immensely proud that his swift actions helped in the rescue of these casualties”.
He added: “Nobody likes to be sitting in a delayed train but on this occasion I am sure passengers will understand and applaud the driver for helping in the rescue of these two people.
“We sincerely hope they make a full recovery in hospital.”
One casualty was taken to the Queen Elizabeth University Hospital in Glasgow by Coastguard helicopter.
The other was taken to Cardross railway station, where medics were on hand to take them to the Royal Alexandra Hospital in Paisley by ambulance.
A Greenock Coastguard spokesman also thanked the train driver, and said the pair had been in the water “for a considerable time when they were spotted”.
He added: “Both casualties were thankfully wearing flotation aids which has kept them afloat whilst being in the water for approximately 60 minutes.”