A sign at Corrour rail station informs passengers there are no buses or taxis to help them with onward journeys. Given there are no roads here, the warning seems unnecessary. Corrour is Britain’s highest, most remote station and is surrounded by Rannoch Moor, a vast, desolate peat bog that stretches for tens of miles in every direction. The public can walk or camp here but they most certainly cannot drive.

Only the train can get you to Corrour – on the West Highland line which stretches through some of the UK’s most difficult terrain and which forced engineers – in the case of Rannoch Moor – to float their track on brushwood mats to get their rails over the boggy, watery soil.

In building the line, which celebrates its 125th anniversary in a few days, Victorian engineers created a railway of stunning resilience – and stark beauty. Head north out of Glasgow and you are almost immediately swept through the lush scenery of the Trossachs, before, nearly two hours later, you cross Rannoch Moor and then head down to Fort William. Continuing west, you cross the silver sands of Morar, with their dazzling views of the Inner Hebrides, to the terminus at Mallaig.

Virtually every mile of the 143-mile trip offers incomparable views. “It is unquestionably the finest scenic section on the whole of the British rail network,” states the transport historian Alan Paterson.

Others go further. In 2009, readers of Wanderlust magazine voted the West Highland line as the world’s most scenic rail journey, and it consistently gets a place in the top 10 of other journey polls. “It is not only the most scenic train route in Britain, it’s one of my favourite journeys anywhere,” says travel expert Mark Smith on his website, The Man in Seat 61.

Facebook Twitter Pinterest Corrour, on Rannoch Moor, can only be reached by rail, as there is no road in the area. Photograph: Antonio Siwiak/Alamy Stock Photo

These wonders have made the West Highland a popular artistic attraction. Ewan McGregor makes his “being Scottish is shite” speech at Corrour in the film Trainspotting while the line’s Glenfinnan viaduct features in four Harry Potter films and now attracts thousands to the steam trains that sweep over the viaduct between Fort William and Mallaig. It is encouraging stuff, given that the line only narrowly survived closure in the 60s. The railway may have been built to bring sheep and fish to Glasgow but it is tourism that has ensured its survival and renown.

Today, ScotRail runs three return diesel trips a day from Glasgow to Mallaig, and six to Oban, while the Caledonian Sleeper runs overnight services from Euston to Fort William. The Jacobite steam train also makes two daily return trips, from Fort William to Mallaig.

But what does the traveller get in return for making these journeys, apart from the scenery? And on its 125th birthday, it is worth asking what does the line mean to the communities it serves? Answers to these questions are more problematic.

On my three days travelling the line last week, the four-coach diesel trains that ply the line provided a punctual service while the staff were cheery and helpful. On the other hand, some seating in the 30-year-old coaches was grim and tacky; electronic display boards invariably gave wrong information while air conditioning was restricted to opening or shutting a few small windows to let in air – and insects. These are the trains that time forgot.

For good measure, there was often no drinks-trolley service – which, for a trip that lasts five-and-a-half hours asks a lot of passengers. “Any other country that possessed a line so scenic would surely do more to make journeys more pleasurable,” says Scott Meikle, of the Moor of Rannoch hotel. It gets 70% of its custom from trains arriving at nearby Rannoch station. “Decent food – not just Coke and instant noodles – as well as more comfortable seats and observation cars would surely help,” adds Meikle.

Many locals bring their own refreshments and to judge from the first part of my journey – from Glasgow to Crianlarich – lager and Irn-Bru appear to be the drinks of choice. Nor is every passenger overawed by the scenery. After 20 minutes, the two lads sitting opposite me simply pulled their hoodies down to their chins and slept face down on the table in front of us. The scenery they missed – the banks of Loch Long and Loch Lomond – is dominated by now badly overgrown woods.

“There have been no cutbacks for decades so you can hardly see the lochs now,” said Doug Carmichael, of the Friends of the West Highland Lines. “It’s a shame for this is a great railway.”

Beyond Crianlarich, the line rises, and trees thin out until you reach Rannoch and then Corrour. The station there may lack roads but it has a restaurant and offers bed and breakfast.

“We have eight trains passing through here a day,” said manager Shona Griffiths. “That means we get a good variety of business.” As we talked, a customer entered and demanded a “decaf, flat white”. Rannoch Moor is clearly changing.

The train then descends to Spean Bridge and on to Fort William before heading west to Glenfinnan viaduct. Apart from its attractions to Harry Potter fans, Glenfinnan has a museum dedicated to the West Highland line, which is run by John Barnes and Hege Hernæs. The latter is a member of a review group recently set up by Transport Scotland to improve services on the West Highland line.

Facebook Twitter Pinterest Harry Potter, with Ron Weasley driving, in pursuit of the Hogwarts Express, in Harry Potter and the Chamber of Secrets. Photograph: Allstar/WARNER BROS

“We need longer trains, but that would mean longer platforms and longer passing loops so trains can pass each other and that could cost millions,” said Hernæs. “It could also mean closing the line for a long time and that is not really an option. So it is a problem.” Beyond Glenfinnan, the train sweeps towards the sea. The Inner Hebrides sparkle in the sun and sub-tropical plants flourish near water warmed by the Gulf Stream. “There is a hint of the South Seas about the scene,” says John Thomas in his rail history, The West Highland Line. “It is hard to believe the wilderness of Rannoch is on the same line.”

At Arisaig, Britain’s most westerly rail station, the line turns northwards to Mallaig. Twice a day, privately run Jacobite steam trains disgorge hundreds of passengers here. Many, adults included, are dressed in Hufflepuff or Gryffindor T-shirts. For two hours they shop, eat and explore a tiny town now bursting with eating places and shops, as well as a Harry Potter museum. “I would certainly not have opened my shop here if it was not for the line bringing Jacobite train customers,” say Sarah Taylor Moore, whose craft store, Highland Koo, opened this year. It is a stark demonstration of the Harry Potter effect on UK tourism, if nothing else.

“It has certainly made a difference,” adds Sonia Cameron, who works at Mallaig on supporting interest in the line. “On the other hand, the railway is simply wonderful in its own right. Some may take the line for granted but most of us don’t. I have never needed a book to read on a train here. The view is quite enough.”

• This article was amended on 22 July 2019 because an earlier version incorrectly referred to the Friends of the West Highland Way. This has been corrected.