Sounds like you read an excerpt from the 1901 novel The Purple Cloud by M. P. Shiel, which appeared as "The Last Man Alive" in the 1988 anthology Science Fiction Stories edited by Edward Blishen. (The story "Bobo's Star" is in the same anthology.) The Purple Cloud is available at Project Gutenberg and LibriVox, and has its own Wikipedia page. The 1959 Harry Belafonte movie The World, the Flesh and the Devil was based in part on this novel.
The protagonist has escaped the apocalyptic pandemic by being within the Arctic Circle at the time.
I did not see him move: I was still a good way off: but there he stood, leaning steadily over, looking my way. Between me and the ship now was all navigable water among the floes, and the sight of him so visibly near put into me such a shivering eagerness, that I was nothing else but a madman for the time, sending the kayak flying with venomous digs in quick-repeated spurts, and mixing with the diggings my crazy wavings, and with both the daft shoutings of 'Hallo! Hi! Bravo! I have been to the Pole!'
[. . . .]
But even as I shouted and whined, a perfect wild certainty was in my heart: for an aroma like peach, my God, had been suddenly wafted from the ship upon me, and I must have very well known then that that watchful outlook of Sallitt saw nothing, and on the Boreal were dead men all; indeed, very soon I saw one of his eyes looking like a glass eye which has slid askew, and glares distraught. And now again my wretched body failed, and my head dropped forward, where I sat, upon the kayak-deck.
He sails the Boreal single-handed back to England, where he reads about the end of the world in a newspaper:
'Telegraphic communication with Tilsit, Insterburg, Warsaw, Cracow, Przemysl, Gross Wardein, Karlsburg, and many smaller towns lying immediately eastward of the 21st parallel of longitude has ceased during the night. In some at least of them there must have been operators still at their duty, undrawn into the great westward-rushing torrent: but as all messages from Western Europe have been answered only by that dread mysterious silence which, just three months and two days since, astounded the world in the case of Eastern New Zealand, we can only assume that these towns, too, have been added to the long and mournful list; indeed, after last evening's Paris telegrams we might have prophesied with some certainty, not merely their overthrow, but even the hour of it: for the rate-uniformity of the slow-riding vapour which is touring our globe is no longer doubtful, and has even been definitely fixed by Professor Craven at 100-1/2 miles per day, or 4 miles 330 yards per hour. Its nature, its origin, remains, of course, nothing but matter of conjecture: for it leaves no living thing behind it: nor, God knows, is that of any moment now to us who remain. The rumour that it is associated with an odour of almonds is declared, on high authority, to be improbable; but the morose purple of its impending gloom has been attested by tardy fugitives from the face of its rolling and smoky march.
He somehow makes it back to the Northern British Isles and travels to London by rail. I believe he used a locomotive, but it seems more likely to have been a handcar.
I examined both engines, and found them of the old boiler steam-type with manholes, heaters, autoclaves, feed-pump, &c., now rare in western countries, except England. In one there was no water, but in that at the platform, the float-lever, barely tilted toward the float, showed that there was some in the boiler. Of this one I overhauled all the machinery, and found it good, though rusted. There was plenty of fuel, and oil, which I supplemented from a near shop: and during ninety minutes my brain and hands worked with an intelligence as it were automatic, of their own motion. After three journeys across the station and street, I saw the fire blaze well, and the manometer move; when the lever of the safety-valve, whose load I lightened by half an atmosphere, lifted, I jumped down, and tried to disconnect the long string of carriages from the engine: but failed, the coupling being an automatic arrangement new to me; nor did I care. It was now very dark; but there was still oil for bull's-eye and lantern, and I lit them. I forgot nothing. I rolled driver and stoker—the guard was absent—one to the platform, one upon the rails: and I took their place there. At about 8.30 I ran out from Dover, my throttle-valve pealing high a long falsetto through the bleak and desolate night.
My aim was London. But even as I set out, my heart smote me: I knew nothing of the metals, their junctions, facing-points, sidings, shuntings, and complexities. Even as to whether I was going toward, or away from, London, I was not sure. But just in proportion as my first timorousness of the engine hardened into familiarity and self-sureness, I quickened speed, wilfully, with an obstinacy deaf and blind.
In London, he finds no survivors, and such a scene at St. Paul's that he has to flee from the smell.
He hits St. Paul's later, but I think you may be recalling the scene at Canterbury:
By the Dane John and the Cathedral, I immediately recognised it as Canterbury, which I knew quite well. [. . . .] Only when I stood at the west entrance of the Cathedral I could discern, spreading up the dark nave, to the lantern, to the choir, a phantasmagorical mass of forms: I went a little inward, and striking three matches, peered nearer: the two transepts, too, seemed crowded—the cloister-doorway was blocked—the southwest porch thronged, so that a great congregation must have flocked hither shortly before their fate overtook them.
Here it was that I became definitely certain that the after-odour of the poison was not simply lingering in the air, but was being more or less given off by the bodies: for the blossomy odour of this church actually overcame that other odour, the whole rather giving the scent of old mouldy linens long embalmed in cedars.
Well, away with stealthy trot I ran from the abysmal silence of that place, and in Palace Street near made one of those sudden immoderate rackets that seemed to outrage the universe, and left me so woefully faint, decrepit, and gasping for life (the noise of the train was different, for there I was flying, but here a captive, and which way I ran was capture).
He continues searching elsewhere but still finds no survivors, and ends up philosophising by a stream or brook.
It was while I was lying there, poring upon that streamlet, that a thought came into my head: for I said to myself: 'If now I be here alone, alone, alone... alone, alone... one on the earth... and my girth have a spread of 25,000 miles... what will happen to my mind? Into what kind of creature shall I writhe and change? I may live two years so! What will have happened then? I may live five years—ten! What will have happened after the five? the ten? I may live twenty, thirty, forty...'
Already, already, there are things that peep and sprout within me...!