William Porter is an inept railway worker who bungles his duties as a wheeltapper and, through family connections, is promoted to station master at a remote, ramshackle Northern Irish railway station on the border with the Irish Free State.
His two colleagues are the elderly deputy Harbottle and the insolent young porter Albert, a duo who survive by stealing goods in transit and swapping railway tickets for food. They regale Porter with tales of the deaths and disappearances of previous station masters—each supposedly claimed by the ghost of One-Eyed Joe the Miller.
On his first morning, Porter is awakened by a cow sticking its head through the window of the old carriage where he sleeps; the cow has been stolen in transit and is being milked by Harbottle, and their breakfast consists of bacon made from a litter of piglets they’re supposed to be tending for a local farmer.
As Porter tries to renovate the station—painting it, organizing an excursion for the locals—a pub fight erupts over where the trip should go. Porter escapes to the landlord’s rooms, where a one-eyed man introduces himself as Joe and offers to buy all the tickets for the village football team’s away game the next day. Porter, perhaps unwittingly, has agreed to move a train for a group of criminal gun runners bound for the Irish Free State; Joe explains these are simply goalposts for the game.
The train vanishes as the smugglers divert it onto a disused branch line near the border. Porter resolves to track down the missing engine. He, Harbottle, and Albert locate the train in a derelict tunnel beneath a windswept windmill. They are captured by the gun runners, but manage to escape by climbing the windmill and down the sails. They couple the criminals’ carriages to their own engine, the Gladstone, and race away from the border, keeping the steam up by burning everything in reach—from Harbottle’s underwear to the crossing gates they smash along the way. Albert clings to the top of a carriage, swinging a large shovel to deter anyone who peers out.
Back at the station, Porter drafts a note and slips it into Harbottle’s medicine bottle, sending it rolling through the station master’s office window when they pass a larger hub to alert the authorities. The railway responds in force, closing lines and re-routing trains until the Gladstone crashes into a siding where the gun runners are arrested by waiting police.
The day ends with a modest celebration. Harbottle reminds everyone that the Gladstone is ninety years old, and Porter jokes that it can last another ninety—just as the engine explodes, leaving Porter, Harbottle, and Albert lowering their hats in a final, quiet moment of respect.