Rail services between Aberdeen and Inverness , Perth and Inverness and Glasgow and Fort William were affected and hundreds of drivers were left stranded on a 25-mile section of the A9 in Perthshire , some for more than 17 hours .