Do you report the incident to the local city when they don't work? Or you can send a letter to your national safety board that regulates freight trains.
> "avoid being hit"
You were not careful enough when crossing the train tracks. When you get a driver's license in Japan, they strictly train (and test!) you to stop at a train tracks (regardless of lights), roll down the window, and listen. If we are talking about a 200 ton diesel locomotive, you shouldn't have any issue hearing it. If you follow these simply instructions, you can avoid most safety issues at railroad crossings. Many trucking companies are required by company policy to do the same.