I don't know your area, but I grew up (and still live) in pretty close proximity to railroad tracks. So here's some general advice:
First, you get used to the sound of the trains. You really do. It still may make your home more difficult to sell when it comes time to sell, but if you're half a mile away or more, you'll find that it won't bother you at all after a few weeks or so.
Second, it depends on what's between you and the tracks. The flatter the land, the fewer the trees, the more the sound will carry.
Third, it depends a lot on the house itself--what it's made of, and the type of construction. Some types of construction will block the sound a lot better than others.
Fourth, it depends on the mix of freight and passenger. Where I live, there are both. Really, you don't even hear the passenger trains. The freight trains will make somewhat more noise. And it depends on whether there's a station or grade crossing nearby. If there is, the trains will whistle (long-long-short-long) as they approach.
Bottom line: You'll get used to it. But recognize that if it's a concern for you, it may be a concern to buyers whenever you decide to sell.
First, go out to the property some evening. Bring some sandwiches and/or a book. Then just sit there for a while and listen. See what it's like.
Second, if the house is unoccupied, ask your agent to ask the listing agent whether you can bring some sleeping bags and spend the night in the house. That'll tell you exactly what the noise is like. (Just remember, though, you will get used to it.)