Parents-in-law live directly next to the ICE line with S-Bahn and freight traffic, about 20 meters from the tracks.
In the old house, you had to stop the conversation when a train came.
In the new one, really good soundproof windows plus extra quiet roller shutter boxes are installed. Thick walls made of sand-lime brick. The result inside is very well done, you only get a slight vibration and a very faint whisper!
I would use the money saved on the land partly not only for the windows but also for a controlled residential ventilation system. And if you are allowed to use the excavation from the slab for that (the plot is really long), build an earth mound at the boundary next to the railway.