I'm in no way defending the six hours, that is unacceptable and will be seriously looked into but you could make all the plans you want and rehearse disruption procedures over and over and still end up with a situation where passengers are stuck on a train for six hours. It just depends on what happens, where you are, what the exact circumstances are etc.
There are procedures in place so making plans like has been suggested have already been done. It's just that those plans can't be applied all the time.
Lets take an incident like this one or Kentish town etc when a failed train ends up being stranded for a considerable time with passengers on.
Quite simply the incident occurs and is no more serious than any other train fault. The driver will report the fault to the box, try the obvious to rectify it and then speak to the fitters. They will then ask the driver to try a few things. Delay may have reached 30mins by now but they certainly wont be contemplating turfing people off of the train in the middle of nowhere.
They will then need to send a fitter or RSI to the train as they will be able to get a better idea from the train than over the phone. This could be another hour for them to arrive. They still aren't going to consider walking people up the track as it is very dangerous and to be done properly needs additional staff to be sent there. (By the way, the live rail isn't a major danger in evacuation-it can be isolated easily. It's everything else that is dangerous and I'm not talking 125mph trains squashing you, I'm talking minor injuries from tripping on debris, slipping on ballast which is very very hard to walk on in boots let alone trainers/flip flops, high heels etc, tripping in cables, slipping on wooden sleepers etc and then you end up with half a dozen sprained and broken ankles who can no longer continue walking to the nearest access point and that's not going into the people on the train who are unable to walk on ballast to start with!)
Fitter arrives and has a look around and comes up with a possible fix. Tries this as if it works it will still be quicker than evacuating the train. As the fitter starts work we could be a couple of hours into the delay. The fitter will need time to do the work. They may need lines blocked, electric supplies switched off, train systems shut down etc to make it safe to do the work. This all takes time. The signaller may say that they can only have the block in 15mins once a train has passed and that the current isolation will be 30mins as they need to get all the electric trains in the area into stations - you can't just switch off a few meters of electric supply in these situations, you are possibly looking at a number of miles being isolated this stranding a large number of trains).
Fitter finally starts work after almost 3 hours and it takes 30mins to do the work. They try it and it doesn't work. Fitter now tries something different so we now have to go through the above paragraph all over again.
At no point during all this is it going to be better to throw in the towel and walk people up the line for the reasons I and others have explained. They will only do this once the fitter/RSI finally decides that they can't do anything at that point. But they will constantly try different things to get it going until they can finally diagnose and fix the exact fault.
After they have fixed it 6 hours have passed and everyone suddenly becomes an expert saying "why didn't you try that first then" and "this is totally unacceptable that you abandoned us here for 6 hours".
It's a no win situation. If they got everyone off the train after 3 hours and then the fitter arrived and said "yeah, just need to push this button and it will fix it" then they will get equally negative press for forcing people to drag all their luggage, babies, dogs, buggies, old or disabled people, drunks, those with flimsy footwear e etc over what is basically a constant scree slope with numerous trip hazards, slip hazards, dangerous objects (the amount of rubbish including used syringes, dog muck etc which litters the railways is quite amazing and should someone slip over and get a dirty needle in their leg then who will be responsible?).
And then when they got them to the access point they would have a long wait for busses to arrive and then people would complain "they should have left us on the train as at least we could sit down there and it had aircon and toilets".
As for simply transferring people onto another train parked adjacent-sadly not that simple. If it were then they wound certainly do it. Too many factors to consider-for a start as said above to do that they may have to stop all work fixing the train which may be the quicker option as they would have to lift any blocks and re-energise and electrical systems if an electric train. Then you need to consider that tracks aren't always close together-they seem close when passing by but can have a big gap between which certainly couldn't be jumped by people (not safely anyway) and wouldn't be easy to bridge without rigging up ladders etc which would ideally need the fire service to assist with.
Sorry for the long post and I hope it ,ages sense and explains the problems here. No delay is intentional and they don't just say "screw the passengers, lets not rush this one", the issue is that its very easy to look back after a big delay and see what went wrong but almost impossible to see what is going to cause the biggest delay at the time.