Whilst I agree with the premise of your post, I think history shows there has been an element of luck. There’s been some close shaves over the period in question, Watford Tunnel in particular could so easily have gone the other way had things been just slightly different.
Heck is the ultimate example of where fortune really wasn’t on the railway’s side. The fact that the car came off the road into the railway in the first place was bad luck, but then massively aggravated by landing in such a way that the train derailed (perhaps it might not have done if a heavy loco was leading, who knows?), a set of points oriented in such a way to deflect the train to the right, and finally a freight train coming the other way at precisely the wrong place and time.
For something more mundane the Peckham detrainment was also one where they got really lucky. That could so easily have led to fatalities.
I think that no matter how good the safety culture is there will always be some element of luck, however I completely agree that the safety focus has greatly heavily reduced this, but it can never be completely eliminated.
The big challenge is complacency and corporate memory forgetting why we do certain things in particular ways which may seem needlessly complicated or archaic.
I'm not really wishing for this thread to become a discussion on the nature and psychology of luck, but I'm afraid that I am not swayed. In a lot of senses I would prefer to call them circumstances.
In some of the instances that you've referred to luck had absolutely no part to play. It was not bad luck that a road vehicle ended up on the track at Great Heck but because the line at that location was not adequately protected against a vehicle leaving the M62 at that location making an incursion onto the line*. Likewise at Peckham (if I have the right detrainment in mind) no harm came to the passengers because someone had the presence of mind to get the power supply to the juice rail isolated.
The problem is that human nature is so prone to looking at a situation and attributing luck, whether good or bad, to the outcome. It's tempting to think
"Phew!! That was lucky" after you've climbed unhurt from your car after losing control on a patch of ice, rolling it and ending up upside down in a ditch. And in a lot of respects, yes, it could have been so much worse. But was that really good luck? Was that really the best of all possible outcomes? I'd say that it's not when you could just as easily ended up spinning 360 degrees, nudging the opposite verge and being able to continue unharmed with no damage to your car whatsoever. In a situation like that, as with the Desiro derailing inside a tunnel, there's simply no way to know if the outcome you experienced was the best of all possible outcomes or not and, therefore, whether or not "luck" had anything to do with it.
(* On the Great Heck crash point, I know that the courts ruled after the event that there was no problem with the length of the crash barriers on the M62 overbridge, but I understand that the reasons for bringing these actions were that Gary Hart and his insurer were trying to prove contributory negligence on the part of the DfT. However, I happen to agree that had the crash barriers been longer they would have prevented the accident by containing Hart's vehicle within the M62 carriageway. Alternatively, a better fence than the simple wooden affair that was there should have prevented incursion onto the railway.
Either way, there were definite attributable causes for the Great Heck crash that had nothing to do with simple bad luck, even if you disagree that the protection against vehicle incursion from the M62 line at Great Heck was a contributory factor. Hart spent the previous night chatting to his new squeeze, was over-tired and fell asleep at the wheel causing his vehicle to leave the road.)