As adults, they have the legal right to make that decision for themselves, but not for their child. A child is not considered capable of understanding fully the consequences of such a decision, and the legal assumption is that the child would take the life-saving treatment if he or she were able to understand the alternatives.
If the issue were that the child will die in 2 months without treatment, and in 6 months with treatment, then I think the parents’ decision to withhold treatment would probably be allowed.
What is the point of legal guardianship then? Why should anyone bother to raise their children if the state owns them?
Medicine is an art not a science. It can't make guarantees like that about anything.