This is a very easy question to answer if you have not experienced it but I believe it is a very difficult decision you have to make in the case, God forbid, this will happen. I hope and pray that God will forbid this from happening.
This time, we can really think hard who would best be saved first but, what if we are now on the situation where we need to decide fast? We will be confused on what we are going to do especially that someone's life is in danger. We get rattled and the worst thing is, we might loose them both.
If I were in this position, I would save first the one who is within reach or closer to me. It doesn't matter if it is my child or my wife. Then after making sure that one of them is safe, I'll come back inside and save the other one as much as I can.