This is not an accurate representation of the situation. In order to save the life of the mother-person, the doctor must take a knife and end the life of the baby-person. In some circles, the argument has been presented that any legislation that ends in, "And then you can kill the baby" is unacceptable. This is a situation wherein the law needs to clearly specify whether the life of the mother-person allows the baby-person to be killed.
What makes it different is the key. In your scenario, the person is allowed to die due to the extent of their injuries. In the ectopic pregnancy scenario the baby-person will only die after its development causes a rupture in the fallopian tube that will very likely kill the mother. It is not a case wherein simply withhold medical treatment results in death.