You can get used to noise if you want too.
A simple thing is to wear ONE Ear plug. YES just one. Your brain gets used to the normal sounds and will soon tune out the train horn and you sleep through it.
Why just one ear? You do want to hear someone pounding on your door yelling fire too. You can also alternate ears that you use the Ear plug.
YOU have to accept that the horn is noisy it comes at about one. You cannot pretend it will not come tonight and I get quiet sleep.
A Mother can sleep in a room full of crying babies. She will wake up when HERS starts to cry.
You make it sound like this noise is continuous for hours and hours at a time. Once you accept that there will be noise for a minute or five or whatever. You will adjust much sooner and just sleep through it.
The train driver is much closer to the noise and he too does not want to hear it either.
The train has been there much longer than you. It will do what it does for a long time. YOU ADJUST to it or move.
I notice you did not complain about the noise of the train just the horn. See you are already used to the noise of train passing. A few more weeks and the horn will sound normal and not be noticed.