Suspect you're thinking about a train annunciator. They use a short section of track circuit to operate automatically. It would also sound continuously while the train was on the circuit. You can guess how that would go over with humans unless there was a designed or improvised silencing device.
Paging Doug Hefty
Did you have the pleasure of dealing with these?
Sorry can't help about the specifics of the one your thinking about.