It must be updated sometime or risk being archaic and unmanageable. Chances are high they are paying insane amounts for those legacy mechanical switches you mention.
The actual logic is usually very well portable to a more modern ecosystem.
Or these companies could pay to train (no pun intended) technicians to learn the systems they’d like to maintain. No matter how old they are.
Until entropy comes for the actual hardware (assuming they won’t invest in remanufacture or production of replacements). Re-engineering a successfully working system is more costly and might result in worse outcomes, especially in the near term.
Often these system rely on old components which are just not made anymore.
People don’t design every switch, computer and chip themselves. They buy whatever mainstream stuff is available at the time and combine it into a system
If you want to resupply those old parts you literally need to search Ebay to buy some weird outdated 2nd hand MSDOS PC to put in your “awesome reliable railway system”.
Upgrading at every new whim is of course bad, but once your system reaches legacy age it’s often necessary to fully overhaul and modernize it for the next ~15-20 years.