Well the real answer is I'm not sufficiently capable to save either from this situation.
Assuming I was capable, but only just capable enough to save one then... well it depends on the context. Hypotheticals without any context are stupid, because there's always context.
More often I'd probably save the person, though not because of any sort of morality that places a random person over things I care about. Just the person can likely talk to me, and thus more efficiently guilt convince me to help him/her. And for some reason they were gagged, I'd probably feel sorry enough to help them.
But let's throw out some more specific scenarios... for fun.
I'm walking my dog and we see the person drowning in a whirlpool, again assuming I'm capable, I try to help her. My dog also jumps in and starts drowning (silly Fido), then I would continue focusing on the person.
The person has kidnapped my dog, but suddenly found themselves drowning in a whirlpool. Well then fuck the person for taking my dog, Rex is coming home alive tonight.
Some bastard has me in a room. The room has 2 exits, both leading to a whirlpool. He tells me that the left room leads to a whirlpool where my dog is drowning. He then has to stop me since I immediately head to my dog before hearing more. Learning it's a stranger drowning in the other direction, does not change my course. Afterwards I push this person into one of the whirlpools. It's his fault for standing so close after risking my Buster's life.
Mother of 3? Probably the person.
Mother of 3 with the small children helplessly watching, probably the person.
Abusive mother of 3, probably my dog.
Escaped criminal, my dog.
Batman, my dog.
(and nice job dismissing the negative possibilities of the stranger while propping up the positive ones, that's fair.)
Oh, and also what @Ragsnstitches and @RhombusHatesYou said.