One solution: add random redirected destinations in interim space. If a ray straight to the target cannot reach the target due to an interfering object (a ship or door in the way), then randomly pick a direction perpendicular to the midpoint of the ray, going about 25% of the distance between the agent and the target. If that is blocked, repeat from the midpoint of the random ray. This way, an AI agent (fleet ship) will continue trying to find a path that may or may not get to the target. This could be used on all sorts of things, such as NPC astronauts in space stations.
What other algorithms might work, other than simply having a large, complicated phantom-rail system?