I think the situation is so very rare, and simple solutions like horns likely to fail, that it isn't worth worrying about.
But that doesn't mean it is a stupid question. There is a related situation that is becoming more common every day. The situation is how do you keep people from stepping off the curb in front of a silent electric car? It is not an academic concern.
The fact is that people are so accustom to internal combustion engine vehicles that make a fair amount of noise, and being able to avoid them by listening, that a nearly silent electric car catches them by surprise. this is a real issue. One proposed solutions is to equip electric cars with a noisemaker to warn people. One proposal was to have a recording of a regular car, keyed in loudness and tone to speed and throttle, play through a speaker on the front bumper.
One wag suggested the drivers could just make 'vroom-vroom' noises.
This is a real issue and one we will be hearing more about in the future.