That's a bad analogy. Let's change it: the man with a mortal lung wound
could use the lungs from the man with the mortal heart wound, but the reverse is not true for some reason involving tissue compatibility. So if nothing is done, both men die. If the heart man is killed and his lungs harvested, the lung man will live. If the lung man is killed, both men die. So either both men die, or the lung man lives. On top of all of this, the heart man is braindead, so he has no opinion and no ability to make a decision, and no real chance at a future anyway.
I'd say it's perfectly ethical to kill the man with the mortal heart wound and take his lungs.