That is always difficult and the decision is up to you and will not be easy.
Humans are creatures of habit, meaning one gets used to certain circumstances, certainly with limits.
There is the nice anecdote where someone was asked if it bothers him to live by the highway.
Currently, we also live by two railway lines, S-Bahn and train. You can hear all the trains (old windows), but the freight traffic is a different category. The glasses in the display cabinet shake. However, the railway line runs about 5 meters below.
It was important to us that the bedroom faces the other side when sleeping at night with the window open.
Otherwise, the question about compensation is quite easy to answer. Which was there first? The railway line or your "house" or the plan for the building area?
It is rumored that this was among other things the reason why noise protection was built (or had to be built) for kilometers along meadows and forests at the A2. It was simply designated as theoretical building land, then the federal government had to pay. If it had later been found that something was to be built there, it would have been the landowner or municipality.
By the way, we have been living like this for 14 years. However, there is a difference between renting and building your own house there.
Just sit on the property on different days. Some things can certainly be considered in the architecture. Something can also be done with planting and vegetation. So it does not have to be a wall to have peace.