In all cases a court can overrule parents.
I understand parents would want to keep their child alive as long as possible, as indeed anyone would want to do for a loved one, but there comes a time when the opinion of medically qualified people out-weighs the parents' irrational wishes.