So, one size does not fit all--might two?
Going for just the one standard will almost certainly mean abandonment of many roads completely, from the above discussion of reasons for installation of smaller gauges in the first place.
Or--since it would seem enterprises don't choose gauges at random or only on petty whims but for good reasons, the rationalizers might decide that one gauge does not actually fit all, and accept some of the penalty of operating with more than one.
Say, wherever small gauge has been adopted simply because the original line was put in by people whose main operations were in small gauge country but they extended beyond that into regions where large gauge works, those lines get replaced.
But once we reach the territory where small gauge makes more sense, the masterminds choose which of perhaps several used is best to standardize on--perhaps the smallest makes the most sense since it works, if inefficiently, everywhere, or perhaps a medium size dominates in laid trackage and the places where the gauge is smaller can take this medium though not full size.
So they wind up replacing much of the small gauge with another small gauge, but not having to do all of it since some is already the size they settle on, and so they have in the end two gauges, standard for reasonably flat lands and a smaller mountain standard for the rough country, and they adopt various schemes whereby they maximize the utility and minimize the costs of maintaining both.
For instance, using three rails one can run the smaller gauge cars on the larger gauge right of way. They might adopt ingenious tricks like developing cargo cars that slide sideways from small gauge bases to large gauge ones, thus enabling cargoes to run all the way from mountain depots to St Louis or Chicago without being reloaded--to be sure the cars running on the big lines will be undersized, so it is a question of which inefficiency is more important to avoid--reloading, or underusing the capacity of the big lines.
A certain amount of variation in gauges would indeed turn out to be mere whim or caprice, with different investors at different times being convinced that one or another was the way to go. The standardizers will have some work cut out for them. My guess is that if they do come around to the idea that they are going to have to maintain two or perhaps three standards, depending on local conditions, that they would invent technical means to streamline the transition of either cargo or car bodies from one set of bogies to another, and thus while widening one line, they can run a temporary third rail down the new track, and devise means to route through traffic running temporarily on the old stock around the construction zone. Or at worst, construct a moving pair of terminals, one on the remaining end of the old line rolling up it toward its final end, and another on the new line just behind the newest construction, and use some kind of inefficient but effective means to port cargo and passengers through or around the construction zone between the old and new lines. Eventually the project reaches the last meter of old line, builds up the last of the old stations to the new standard and the old rolling stock is junked.
Sometimes they'd be lowering gauge though, and then as said by others above the reconstruction is easy, and they can just lay in a closer third rail to be used by their narrow-gauge stock eventually while running the old medium stock through until the third rail is fully installed.
I suppose the way to do this is to send tracking experts on expeditions down each existing line they acquire, with a keen eye out for the most constraining turns or inclinations, tunnels and bridges and so on, and when they come to these to evaluate the largest gauge (from the list of the existing ones) that passage could handle without major rerouting. Then estimate the cost of upgrading to standard up to the first point that standard is too large for, plus the cost of switching over to the largest gauge that passage could take, and when they've got all their data collated at HQ, figure out which existing smaller gauge could accommodate all the stretches between such choke points at the lowest overall cost--factoring in avoiding regauging wherever possible, the possibility of major reworking enabling a larger gauge, the higher price of going up gauge versus down gauge set against the greater efficiency of higher gauge where it is possible. It would be quite a bureaucratic undertaking to be sure! They might have to decide to either continue some spur operations on very small gauges at some loss of profit or shut some of those stretches down completely--or put them up at auction, with a promise to provide terminal service transferring goods onto their lines if some third party will undertake to operate a spur.
Ideally they wind up with just two gauges, with a minimum of transfer points.