First ScotRail said a snowplough had cleared the track and a four-coach relief train carrying food and water reached the area to collect those on board at 0130 BST.
The passengers eventually reached Inverness at about 0315 BST.
A spokesman said passengers were "tired and fed up" but "no-one is in distress".
One passenger told BBC News: "We ploughed into this great big snowdrift and stopped. We couldn't go forwards and we found we couldn't go backwards.
"So they sent out another train but that got stuck too. So eventually they had to dig a kind of trench and bring in another train and get us out."
Elsewhere in Scotland, Scottish Power said 2,500 properties were still cut off from its network and Scottish Hydro Electric said 2,000 of its customers were without power.
In Northern Ireland about 30,000 homes remain without power after an ice-storm knocked out parts of the electricity network.
Up to 100,000 people were affected by power cuts on Tuesday and Wednesday and hundreds of faults still need to be fixed.
Officers said driving conditions across Northern Ireland were "treacherous" and advised motorists to slow down.
A severe weather warning lasting until 0800 BST has been issued for icy roads.
On Wednesday, Natasha Paton, 17, from Cleghorn, was killed when a school coach crashed on the A73 at Wiston, South Lanarkshire.
Natasha Paton died in the crash near Biggar in South Lanarkshire
Natasha's parents issued a statement in which they said they were devastated at the loss of their "beloved daughter", adding that she would "be greatly missed by all who knew her".
The crash prompted Prime Minister Gordon Brown to speak of the need to ensure school buses are safe.
"It's very important that we look at everything that ought to be done to make sure that our buses are as safe as possible for young people," he told Radio Clyde.
The school coach had been carrying 39 students from Lanark Grammar School, five members of staff and a driver when it left the road and finished on its side just after 0600 BST.
NHS Lanarkshire said 44 people in total had received hospital treatment following the crash.
Were you on board the stranded train? Are you affected by the power cuts and severe weather conditions? If you have any information or pictures you would like to share with us, please use the form below.
Send your comments using the post form below.
Send your pictures to firstname.lastname@example.org, text them to 61124 or you have a large file you can upload here.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.