North country tracks ... take the train into the wilderness of Scotland. Photograph: Jay Dickman/Corbis

On first encounter with the Far North railway service between Wick and Inverness, you are inclined to rub your eyes in disbelief. You may be fishing (as I was) or bird-watching or tramping; anyway, doing something solitary in one of the emptiest corners of the land. Then out of the emptiness rattles a train. Where, you wonder, has it come from? Where can it be going?

A year ago I was nearly killed by it at Kinbrace, a tiny town in the county of Sutherland of half-a-dozen cottages, a station and a primary school. I was in a car, daydreaming, when I came down to a crossing. There was no barrier and I missed the warning lights until I was almost onto the track. There was an immense blast of horn in my ear, the yellow nose of the train almost on me, then the thunder of it behind me and the pounding of my heart.

Having nearly perished under the train, I became curious about it. So, on the first day of May, under grey, moist skies, I boarded it at Thurso, the most northerly railway station in Britain. My single to Inverness, 160 miles and three-and-three quarter hours south, cost me £15.50. My regular train ride is from Reading to London, which is 35 miles, takes 25 minutes and costs £17. I was a world away from home.

Thurso the town was left behind. Beside me was Thurso the river, full from the recent rain, tea-coloured from the peat, enticing from the salmon angler's point of view, and close enough at times to land an Ally's Shrimp or a Hairy Mairy in the foaming water. First stop was Georgemass Junction, where the branch line from Thurso joins the main line from Wick.

We headed west into the wilderness known as the Flow Country, a vast tract of peat bogland devoid of any obvious sign of human activity, apart from the railway and lines of stumpy, slowly collapsing fences. To the untutored eye, particularly one in a moving train, it is empty, featureless, utterly desolate. But the Flow Country is actually a very rare and very precious peatland ecosystem. That it remains so is due to gallant campaigners who, back in the 1980s, fought to rescue it from the grasping paws of the forestry companies, and to the RSPB, which secured it and looks after it.

A man in green wellingtons got out and strode purposefully off into the soggy void at Altnabreac, perhaps the most implausible station in Britain. There are two houses at Altnabreac. And some trees, some lochs, some streams, and a lot of bog. No road, just a forest track. Five years ago its station was used by 93 passengers in an entire year. It is, to put it mildly, an odd place to be able to get on and off a train.

Beyond Forsinard, where there is an RSPB visitor centre, a stag stared at me and bounded away in alarm. We passed glowering blocks of Christmas trees, clumps of Scots pine, an occasional farm. At Kinbrace the line joined the valley of the Helmsdale, where a day's fishing costs as much as the average monthly mortgage repayment. The land becomes greener and friendlier as the river, and the railway, snake towards the sea.

Helmsdale itself is an old herring port, snug against the hills. The train almost hurls itself into the sea as it turns south, the line hugging the stony shore so close you can almost feel the surf breaking. Beyond Brora, the next port south, we passed the gates of Dunrobin Castle, one of the Dukes of Sutherland's many homes, whose fiefdom this was.

The 3rd Duke was the richest, the most aristocratic, and the most fanatic of train buffs. It is thanks to him – he was paying the bill, so no one argued – that the Far North line now executes a wide and eccentric loop to the west, to reach Lairg, the centre of the Sutherland sheep-farming empire. A few miles south of Lairg, high above the station at Invershin, is an unmissable and rather ludicrous building, a cross between a schloss and a chateau, from whose battlements hangs a spicy story.

To the shame of the Sutherlands, the 3rd Duke wearied of driving his train and took up with a Mrs Blair, for whom he abandoned his duchess. The duchess having faded away, and Mr Blair having been disposed of in a curious shooting accident, the Duke married the widow and died. After a vicious legal battle with the family, she walked away with half-a-million pounds, much of which went on building this affront to the dignity of the Sutherlands. She called it Carbisdale; everyone else called it Spite Castle.

Between Invershin and Inverness, the journey becomes less remarkable, though never less than delightful. I watched as the waters of one after another of Scotland's notable salmon rivers – Oykel, Cassley, Carron, Alness, Glass, Conon, Beauly – flowed beneath our wheels. There was one last river, the Ness; then Inverness itself, where I waved a grateful farewell to the little blue train with the yellow nose that had taken me on such an adventure.