It's an inherently technological problem, that could be solved multiple ways:
- Freight trains that are less noisy: Easy. Lubricants have existed for decades. Unfortunately, the freight train operators would have to pay this and why would they?
- Software that prevents automated announcements from playing when a freight train is in the station: Semi-easy. The technology is there, but it would require coordination, difficult system integration and development. Unfortunately, the train station operators would have to pay this and what are you gonna do if they don't? Go to another station?
- Rails that can be used to reroute freight trains around passenger stations: A bit difficult. The technology is there, but it would require massive construction, additional land and lots of money. Unfortunately, the state would have to pay this and the state is always broke. (Also, I'll admit that money can be spent more wisely)
- Finding the same information in the app of the railway company, using your smartphone. Easy in theory. The systems are there, paid for (in part by public money, probably) and smartphones are usually owned by anyone. Unfortunately, the railway company would have to use the systems properly, for the information to be as accurate as the announcements and people are idiots.
- Specialized augmented-sound earpieces that use machine learning to filter the announcement from the noise and enhance it. Stupidly difficult. Technology is not there yet and if it were, it would probably be very expensive. Fortunately, it sounds "cool" enough, that a tech start-up is probably working on it right now and the problem might be solved in a few decades for those with big amounts of disposable income. Hooray.