I would also like to know why you think a modern diesel generator and electric motor would be more expensive and difficult to maintain than a steam engine.
Having been involved in other industries with similar obsolesence problems this is my take:
Motors and electromechanical control gear (Contactors, overloads, fuses, switchgear) Simple replacement with few problems beyond a bit of 'fitting' in cases where sizes are slightly different
Systems using well documented microprocessor architectures, 8085, Z80, 8086 and upwards (80x86) ARM, 68000, and a few others. More involved, but firmly in the 'doable' category, but with the proviso that these systems frequently have I/O cards or interfaces which use custom or obsolete chips, in one case I did a system where ALMOST everything was straightforwards, with the manufacturer offering an upgrade path, and the tools to support it, except for one 3rd party I/O card. One fairly simple part of the system actually soaked up as much time as the rest of the conversion to a modern system took. (This was late 70s tech in the late 2010's)
Custom systems, these are the ones that really cause trouble, I have seen systems with 'CPUs' made out of TTL logic chips for example. Frequently the supplier no longer exists, documentation tends to be sketchy at best. Really these systems have to be completely removed and re-engineered from scratch once the supply of spares has dried up, in our industry if they are basic control systems with no safety 'significance' then that process is time consuming but doable, as soon the system delivers any safety functions, rather than relying on other systems to maintain safety it becomes an almost impossible task, which would only be undertaken if there really was no alternative.
I have no personal experience of the rail industry, but talking to others who have the issues are the same.
The problem, if for example a motor needs an adapter plate machining thats a fairly simple task, draw it up, get it made, fit it. It takes time and money, but as a job has a clear 'path' and the likelihood is it will fit and work. The same with the majority of steam engine parts I suspect.
As soon as you get into software and firmware the testing required demand expertise which will not come cheap, and there maybe unexpected results during testing, including 'bugs' in the original system, my experience is that you frequently encounter sometimes major issues which can mean costs and timescales mushroom.
On the mechanical side diesel engines can be swapped out for a similar modern unit, again fairly straight forwards, it happens all the time across all industries.
In terms of the preservation movement, there is a good infrastructure and knowledge base for steam stuff, but dealing with for example early 80s tech I suspect would be way beyond the resources of the preservation movement in a lot of cases. A series of 'bodges' which allows an enthusiast to run an early arcade game for example would probably not be acceptable on a railway engine, even one limited to 20mph or so.