Depending on the situation, police from the local jurisdiction could conceivably be stationed on the land end of the gangplank.
I think the coast guard has sole jurisdiction over ships at sea. wildman will know how it actually works but I assume the local coast guard commander has the last word on what happens.