I honestly don't see a problem with that, as long as the woman gave her consent while she was of sound mind. Surrogate pregnancy is already a fairly common thing; this is just extending it to after one is brain-dead.
Obviously if it's done nonconsensually that's an entirely different matter, and is a horrifying idea (imagine miraculously waking up from an 8 month coma only to find you're pregnant with someone else's child).