As I sit on a Virgin Pendolino train heading to the north-west, I reflect that this is about the best our railways can offer but it's still terrible. The carriage is cramped, the seats are too small, and the environment is made intolerably stressful by the neurotic announcements of the guard and an incessant electronic beeping. I don't think I've ever been on a Virgin Pendolino without hearing the repeated automatic announcement "Attention, train crew: passenger emergency alarm operated" triggered by mistake, the alarm being located in the lavatory where the flush button ought to be.
This frustration is aggravated by the thought that we invented railways and gave them to the world, and by the banishment of any sense of railway romance from our lives. This is true to the extent that any Briton writing a book about railways must begin with a short apology, just as so many of our train journeys do. Christian Wolmar starts by declaring that he has "eschewed nostalgia", and he warns us to be on our guard against overenthusiastic railway histories. But Wolmar - often referred to as our leading railway expert - is a romantic in disguise, thank God, by which I mean that his hard-headed analyses are complemented by a taste for the picturesque and the bizarre.
In 1825, George Stephenson inaugurated the Stockton and Darlington Railway, a single line for hauling coal. When, in 1830, he opened the Liverpool and Manchester Railway, which was double-tracked and carried passengers, the whole world was watching. The importance of this British brainwave was grasped instantly. In 1828, the first sod of earth for the first American line, the Baltimore and Ohio, was turned by Charles Carroll, the only surviving signatory of the Declaration of Independence, an event he suggested would come to be seen as of secondary importance to the opening of the line.
Our forefathers built railways in Africa (pursuing Cecil Rhodes's ghostly, elusive dream of a "Cape-to-Cairo" line), India, China, Argentina and Australia, among others. In the early days, it was prestigious to have a British train driver, just as it was once the thing to have a French chef. In building their own lines, most of our competitors paid homage to Stephenson, in that his track gauge of 4ft 8½ins was usually adopted, but the French and the Americans in particular favoured a bigger "loading gauge". Their locomotives and carriages were fatter, in other words, and already a certain skimpiness was becoming a characteristic of British trains.
As our rivals ran with the ball, they did so amusingly in accord with any bigot's view of national characteristics. The Americans built their railways like the British, only more so - trusting largely to private enterprise, with results both heroic and chaotic. The transcontinental route was laid by the Union Pacific pushing west, and the Central Pacific pushing east, both accompanied by raucous, rolling towns on wheels. But these two lines did not at first join up as they converged in 1869. Instead, they snubbed each other and ran parallel for many miles, each company keen to continue receiving the government grants that helped fund construction.
Wolmar has some lurid accounts of the early American railways. Timekeeping was so poor that the phrase "to lie like a timetable" gained currency. Single lines preponderated (well, they were cheap) and signalling was primitive, with the result that "cornfield meets" were common. This sounds like the term for an amiable hoedown, but actually it denotes the headlong smashing of one locomotive into another. The locomotives of the South Carolina Canal and Rail Road Company illuminated the track ahead by pushing along a truck on which a bonfire blazed.
In France, meanwhile, intellectuals agonised over the aesthetics of railways before the state applied itself to building what would become the biggest and most elegant high-speed network in Europe. Even the language of French railways is beautiful. They gave us the word "express", and their non-high-speed lines are flatteringly referred to as lignes classiques. In the nascent Germany, Bismarck saw the military potential of railways. Wolmar is particularly good on this. Historians often assert that the First World War was a direct consequence of the coming of the railways without saying how. The fact is that railways allowed Germany to believe it could conduct a war on both its western and its eastern flanks. Wolmar also explains that railways favour a defending force - in that tracks laid down by attackers will be subject to sabotage - and so they perpetuated the stalemate of the war.
Let's see now . . . Spain, stand-offish from Europe, built its railways with a 5ft 6ins gauge to deter would-be invaders from the north. The first Australian railway was partly built by convicts. Oh, and Albania didn't have any railways at all until 1947.
Wolmar brings great energy to the task of explaining how railways altered the world, but this is like trying to explain the importance of water. Railways changed the concept of time and the scale of human existence. They were so elemental that their effects were frequently contradictory. They denuded the countryside, but then became the saviours of it. Vicars and young boys love railways; so did Hitler, Stalin and Mussolini. Railways spread epidemics, but also relieved famine.
Dr Arnold, seeing a train thunder past Rugby School, took this as a sign that "feudality" was gone for ever, but railways also promoted a social hierarchy. Most early railway carriages had their own class systems, after all. And railway development created the "wrong side of the tracks" in many towns. Wolmar also argues that it spawned the professions that would be the basis of the middle class. In measuring the significance of railways, he is again helped by his eye for the luminous detail. In Britain, for instance, railways resulted in London losing its cows (as milk could be brought in from outside); and they made fish and chips a national dish rather than one available only at the seaside.
The worldwide eclipse of railways by cars and aeroplanes is being reversed. Many countries are seeking aesthetic and environmental relief from the motor car. European holiday brochures now commonly show railway lines, never motorways. In spite of Barack Obama saying that he is envious of the railways of Europe, America is a laggard here, which seems particularly ungrateful in view of the maxim: "The European countries developed their railroads; the American railroads developed their country." But Wolmar argues that US railways are still paying the price of monopolistic practices in their heyday.
But we, and they, will come around. Wolmar is confident enough to end his book on a note of uncharacteristically light-headed fantasy. He invokes the "delicious prospect" of trains outliving automobiles. Perhaps we will indeed come to look back on cars as a mere blip. (And Jeremy Clarkson, too).
Andrew Martin's "Ghoul Britannia" is published this month by Short Books (£12.99)
Blood, Iron and Gold: How the Railways Transformed the World Atlantic Books, 400pp, £25