IMHO, part of the problem is modern trains.
Back in the old days, trains broke down but could in many cases be hauled or propelled by another train or by a rescue locomotive, most failures were fairly simple loss of power, whether steam, diesel, or electric.
These days, many failures seem to be "computer says no" when some real or imagined fault locks the brakes on. Attaching another unit can result in both being stuck.
And of course each new generation of train seems to be incompatible with existing types, so less opportunity for rescue by the following service.
Newer trains are also far more unpleasant to be stuck in for hours.
Sealed windows and locked doors are most unpleasant in hot weather.
Toilets if provided at all are out of order without electric power.
Back in the old days I recall a prolonged delay on a slam door EMU. The windows all opened, even the doors were opened on the side away from other traffic, the toilets still worked, the buffet was still open.
A new train with locked doors, sealed windows, no buffet, and locked toilets would be far worse.
On todays railway, a prolonged stoppage really needs to be treated as an emergency and not simply as a delay.
Rescue needs to be arranged or at least escape needs to be permitted a lot more quickly than at present.
Factors that need to be considered include on board conditions.
Are significant numbers standing?
Are toilets available?
Is it very hot or very cold on board ?
Is lighting available, if not in daylight.
Best case, evacuation NOT urgent. Everyone seated, engine running, heating or air conditioning available, lighting working, toilets working. In such circumstances, the delay is regrettable, but rescue not urgent. Conditions are no worse than with the train moving.
Worst case, crush loaded train, no toilets, darkness, no refreshments. In such circumstances rescue is URGENT due to the conditions, and in such conditions, IMHO, rescue should be actively considered in the first hour, and be a legal requirement after 120 minutes.
A good example of this was last years strandings in the Lewisham area. To keep passengers locked on crush loaded services , in the dark, without toilets, for hours was simply unacceptable. I too look forward to reading the report into that incident.