Some Union ships carried contingents of Marines on-board. Perhaps he was the clerk of the Marine Captain, rather than the ship's captain.