The official website for The Settlers of Catan

Question about Combination of “Traders & Barbarians" with "Seafarers” Traders & Barbarians + Seafarers (in general) - May I move the wagon from a road onto a ship if there is no settlement between the road and the ship?

Answer

Yes. When you move a wagon, it doesn’t matter whether you move it along a closed or an open trade route.