The photos below show one version of a pre-1945 railroad signal. Other models exist.
These were used on tracks when personnel worked close to, or on the railroad tracks.
When the train-driver ran over these, a loud explosion was heard which alarmed the driver to slow down and stop.
The thin zinc body was filled with a pyrotechnical mixture. The brass strap allowed the alarm to be fitted to the track.
Click the images to enlarge.
Photos below © Jarda Mattas