(Courtesy SDRHT via Telegraph 30)
One way is to use CPOs (compulsory purchase orders) to purchase blocking properties. A second way would be to bridge/tunnel. A third way would be to utilise street running, though this may be a little radical for some!
But I suspect that often the option will be a by-pass. The above map was drawn to show how this would work at Shepton Mallet. Actually seeing it on paper shows that there can be other advantages to by-passing, at Shepton for example the station set up can be rationalised, a joint station would be accessed by both the S&D and East Somerset lines. This is cheaper and also handier. The above map also includes a Parkway station, though I suspect that by the time this becomes reality there will be few cars still on the roads!
So the principals established can (and will) apply to anywhere on the S&D and of course on the wider network. The old excuse of 'there's a house/building/car park/tree in the way can be ignored!