I can't see that anything is different except each respondant's assessment of personal risk will vary depending on their relative skill level in each of those two situations.
In any case I would be doing a rapid risk analysis and going with my gut - there are times I have interceded/will intercede and times I didn't/won't - personally I'd be less likely to jump in the river because I think my risk of throwing my life away in vain is much greater in the river. Based on my life experience to date I have much more faith in my ability to handle human situations than to swim that well in a river (don't get me started on the people who drown trying to save their dogs...).
What prompted me to ask my question was the phrase "That said, in my own mind there are certain situations in which you simply do not consider your own welfare", which was a bit at odds with the rest of the post (paraphrased: don't risk yourself to try to help in a situation where you don't have the skill to actually help). The situations may not be analogous, but then again they may be. It's not completely impossible to save someone while drowning in the attempt, it does happen, but much more commonly both victim and would-be rescuer drown (and, possibly, the victim might have lived if the rescuer had run for help instead). It's perhaps somewhat less unlikely to save someone from an attack while getting hurt or killed yourself, but I don't know.
A lot can be encompassed by the phrase "try to help", and maybe that's what we need to focus on. If you take a lifesaving course, they teach you to "reach, row, throw, go" to a person in trouble in the water, in that order
-- all ways to try to help someone. A swimming rescue is the very last choice, to be used if other options (safer for you and
more likely to have a good outcome for the victim) have been tried. "Try to help" in an attack should be regarded the same way.