I used to live directly opposite the Craigieburn line (in Flemington, just up the street from Newmarket station) - opposite, as in, my neighbour on the other side of the road was a train.
What they say about getting used to the noise is mostly true. But that depends somewhat on what line you're on.
Our line shut down overnight, so sleeping wasn't a problem (even though our single-glazed bedroom window faced the train line). One or two trains passed after bed time, one or two passed before up time, but most of the night was quiet.
But one week they did trackwork on the main Northern freight line, and re-routed all the overnight goods trains past our house. Goods trains are significantly heavier than passenger trains, so the earth moved. And they're longer, so the earth moved for longer. And they don't stop after midnight. We didn't sleep much that week.
Normal times... trains were moving reasonably fast by our place, so they were loud but brief. We got used to pausing conversation briefly until the train was gone. Visitors found it amusing that we didn't notice we had done it.
Our cat caught a train, with very permanent consequences.
We were robbed twice. That has more to do with being very predictable in our movements (both out of the house 7am - 6pm every weekday) and maybe a bit to do with the demography of the inner West in the early 00's, but we were also an easy target in that nobody was watching from over the road, and there was plenty of reliable acoustic masking to cover the sound of a brick going through our window.
The upside, of course, is that public transport was extremely convenient. And not just trains - stations tend to be a local hub for whatever other PT is in the region, be it trams, buses, a taxi rank, whatever.
If you want to be close to stuff (ie inner 'burbs) you have to be close to stuff. And a railway isn't such a bad thing to be close to. Especially if you're buying, so you can look at doing some acoustic work to the house if needed. We renters (at the time) had no such luxury, so we just put up with it. And it wasn't all that bad.