I'm afraid we differ fundamentally. Reasonable efforts need to be made to point out danger, but if people don't heed it in my book that's their fault - one needs only go so far, in my view. And if you're wanting to cut many deaths rather than edge cases of people leaning out of train windows, ban all motor vehicles immediately. They are one of the biggest killers in the world, and near enough all of them have leanable windows!
And, yes, the penalty for gross stupidity often is death. It still often is, for example, if you jump/zigzag level crossing barriers. There is simply only so far it is sensible to go unless we just give up and stay home....which is where most accidents occur!
Edit: I would generally go along the lines that non-obvious dangers need to be guarded properly against, and those which are a specific risk to children - for example, it would be stupid if by fiddling with the door buttons you could open a train door while it was in motion (though there are countries where that[1] is the case, and I nearly fell out of one as a result, it'd have been safer just to leave it open as that would be an obvious danger) - but sticking your head out of an awkwardly-positioned slider vent on a train saloon window is such a deliberate and obviously dangerous[2] act that I see no particular need for it to be physically prevented.
[1] Worse, actually - the door opened itself on a sensor as I approached it to look out of the window, expecting to be able to lean on it! This was on a night train in Thailand. FWIW, the method of locking the doors to prevent this was...to operate the emergency release handle to depower the door!
[2] Actually not that dangerous on most lines as you wouldn't get your shoulders out, and the clearance on most lines (other than oddities like the Cumbrian Coast) tends to be more than the height of a typical adult's head alone.