When building a ghost rail over ghosts, no object deletion, simply skips the ghosts in a weirdly unhelpful way:

When building a ghost rail over built entities, you now get completely useless object-avoidance routing instead of the useful deconstruction behavior:

This should be normalized. Given the fact that object avoidance is a completely useless feature in ghost rail building, I would suggest that all rail building work like the first example, and not the second. That option also has the advantage of working like blueprints do, which should make the game simpler and more consistent.
Or, perhaps a third option would be to have rail building do the same thing to player built entities that it does to everything else and simply marks them for deconstruction and builds right over them. Then, when building over ghosts, you could simply delete the ghosts. The reason to choose this option would be that rails are much too important to ever avoid anything at all in the environment, ever. Doing so is obviously useless, the devs said so.
I only noticed this because I saw this blurb in the release notes for 17.35 and foolishly acquired a glimmer of hope that maybe the devs had changed their minds:
[*]Fixed that ghost building mode works the same as ghost building (with shift) when it comes to rail building. (69761)
But, no, after grabbing a copy of 0.17.36 and trying it out, it was clear that wasn't what that change was about. And as I mournfully fiddled with the rail planner, I had the idea of maybe just putting ghost buildings all around areas I wanted the rails to avoid, to sort of fake it out. But no, that won't work either because of this bug.