The official website for The Settlers of Catan

Question about “Seafarers” Expansion Ships - Do I lose the Longest Trade Route while moving a ship?

Answer

No. You don’t lose the Longest Trade Route when moving one of your ships, provided that after its relocation your continuous trade route is at least as long as before.