Ah yes indeed. The trouble is that the likes of Stannier, Gresley, Riddles and even O.S.V.Bulleid and the like only had the mark 1 brain which was connected to the AO drawing sheet via a slide rule. Added to which others were hard at work with the brain child of Heir Diesel which even at its earliest stage gave the kind of performance and returns of fuel consumption that the steam men could only dream of.
However, you are quite right that given modern computing power, materials and the rest, a computer managed, gas fired steam locomotive would be thermally very efficient. I have seen one in the USA at one of the theme parks. Its the ugliest thing you ever saw, it works beautifully but it is a thing of little charm and very little chuff which tells you its very efficient. Its a sort of blob on wheels wrapped up in aluminium foil over fibre glass held together with chicken wire. British Rail in its hey day owned and operated about 20.000 locomotives. I wonder if the R&D costs could be recovered by the savings in efficiency. I doubt that given the modern craving for all things electric that the computer comtrolled all electric loco ie cl 91 and that which is to follow could be improved on. Added to which the GM cl 66 Diesels have I think probably nailed finally the commercial redevelopment of the much loved steam locomotive.