It startled the train which bolted and shied to one side.
Trains should be fitted with blinders to prevent this.
The train could have been startled and took off in fear. Yep.
Or maybe the engineer was having an asthma attack, hanging his head out the window for air when he got his bell rung by a projectile.
Like a slapstick skit.