You really have to be careful once you board the ship. Always been keeping an eye on your character and the ones around you, once you are on that ship it seems like everyone is out for you if they are near you. No matter if they are fighting another one of your crew mates they will attack you. So just be aware of your surroundings and when you see the opportunity to block and reverse an attack do that immediately. Even if you are in the middle of fighting another sailor. The blocking and reversing will save you every time.
That happened to me to begin with. My health would drop critically low and i would jump in the water till my health improved or jump back on the boat. Also i wouldnt be so quick to jump on the boat and would shoot at the enemies from mine first to kill a few. The above advice helped me a lot once advised by my friend :-)