If you have given them Right of Way the AI does tend to use this freedom of navigation. Their desire to cross your land is influenced by the distance and size of the threat of course. The AI tends to βturtleβ and only react when provoked.
with that said, if player A attacks this AI, the AI will cross the territory of player B to reach player A, regardless of having right of way or the possibility of declaring war.