The rail industry engineers do an excellent job of trying to get upgrades and enhancements done without fundamental impact on lineside neighbours. With Kinghorn tunnel, I think it may be time to consider whether the easiest option is to just CPO the houses above the tunnel and move the residents out. If there's no one above, then the impacts of tunnelling subsidence are reduced. Utilities can be disconnected to prevent leaks and the risks they entail (e.g. gas). If the necessary permissions exist, then the houses could be demolished either in advance of work, or when the ground conditions mean it's not safe to continue any reboring operation below. Once the tunnel is rebored and the ground made secure, the land can be resold for housing. If the structures are still sound, then that's great. If not, then it's just some serviced plots with planning approval for replacement homes.
If we don't start embracing the opportunity to redevelop as part of upgrade works, then we'll never be able to make forward progress with rail or any other infrastructure. Over time, the range of projects which can be delivered by doing careful open heart surgery with minimal impact on neighbours is diminishing. Land gets sold off and easy upgrades get done early, leaving only reduced land and harder projects left to do. If we don't start resetting the law of diminishing returns by getting the bulldozer out, then nothing will ever get better.
The greatest taboo we seem to have nowadays with housing is this idea that our existing stock private owner-occupied housing is fundamentally perfect. If anything needs to be done, it can be done piecemeal and house-by-house (e.g. roof dormer, side return and garden extensions). But this isn't based in reality at all. Our housing stock is increasingly ancient and deeply unsuited to modern lifestyles. A nice old Victorian house that doesn't have consistent levels on the ground floor is an accessibility nightmare. A bathroom being a few cm too narrow means it's impossible to make it accessible. Most of the easy upgrades (e.g. fitting central heating) have already been done, but we've got a lot more we can do. And in a lot of the areas with the railway nearby, we just don't have enough housing at all. If the railway could redevelop the land near station upgrades into flats, then it could help pay for the scheme and result in more fare-paying passengers guaranteed for generations to come. The most successful passenger railways have always depended on residential property development as a core part of their business and we seem to have forgotten that, to our immense cost.