Smart sea captain and yes, the captain is the absolute law at sea. I believe in due process but I don't believe in "overdo"ing due process. Common sense should trump some things. Unfortunately two primary groups are against common sense. 1. Lawyers, who don't want common sense as it would significantly reduce their opportunities for abuse and excess and 2. Liberals, who operate from emotions and feelings and can't mentally cope with common sense.
As I said, it is impossible to "accidentally" pirate a ship so executing them on the spot is only going to eliminate pirates and huge amounts of wasted resources arresting, trying, appealing and incarcerating or executing them later.