Sorry, my answer vanished.
Surgeons of that era were rarely physicians ie doctors educated at University, thus they could not be addressed as doctor. In current UK practice, surgeons who are now educated as physicians, are addressed as Mr, Mrs, or Ms a long standing tradition based on this. The other medical professional common at the time was an Apothecary.
O’Brian’s Dr Maturin in the Aubrey/Maturin series is the rare ship’s surgeon, who was a physician.