Having the higher ground in a dueling situation is generally considered advantageous.
By whom? Source? (I hope the source is not Anakin vs Obi-Wan fight 🤣)
While the lower ground combatant may have an easier time striking the legs, the higher ground combatant have a reach advantage towards the opponents head
We are talking about standing on a raft vs floating in water. That's a massive height difference, the head of the lower fighter would be literally at the height of his opponents ankles. If the ground height difference was slight, like 20cm, then yeah, you would need less reach to attack head, but only slightly. And lower body attacks would still be problematic, just to a lower degree, so even at low height differences, it's probably not worth it.
which is a more vital body part
Doesn't matter if your opponent is cutting through your knees while you can't hit him at all.
The one who can hit from farther away is at an advantage, even if his opponent can hit stronger.
(Also head was usually much better armoured than legs.)
The kind of weapon used matters, of course: a dagger would be awkward to use, while a spear would reach the lower ground opponent easily.
But your opponents spear would reach your legs much easier.
In the case of a craft, the person on board the craft can also step back and concentrate on attacking during the swimmer's attempt to climb onboard the craft and to push the swimmer back into the water, waiting for the swimmer to tire.
I only quoted the "being higher" part, and that's the only thing I am referring to. I absolutely agree that attacking someone on a raft by swimming to it is extremely stupid, and you are at a major disadvantage due to worse mobility, lack of footing, and having to constantly swim. It's only the height part that I disagree with.