Guy Nankamp is a Cameroonian inventor who has designed an automatic and autonomous system that regulates traffic at railroad crossings. Thirty (30) seconds before a train reaches the crossing, for instance, a display board starts to operate automatically such that, 15 seconds before the train reaches the crossing, a red light switches on that will trigger a siren. The barriers located on both sides of the road will then be lowered automatically.
Source: Guy Nankamp
Now, if a railway station or any other area deemed dangerous is equipped with the system, the train driver will be informed, 5 minutes before reaching that area, of the necessity to slowdown the train thanks to a box located in front of him.