At a scenic viewing spot with a rail, I expect the rail to have small spaces and enough height that it’s almost impossible for a child to squeeze through. When I was little, and even now, my mom would not let me lean on a rail. I grew up with terraces way up in the air in tall buildings, and pretty much we didn’t touch the rail.
But, mostly, I’d say it’s a matter of shit happens. In two seconds a kid can get himself into trouble while the parent looks away or spaces out for a moment. I always say children under 5 are suicidal. It’s like their soul is trying to go back. They go to pools when they can’t swim, put metal in electrical outlets, and dance near the edge of a cliff.