The high-profile battle in the British courts over the fate of Charlie Gard, a brain-damaged baby with an incurable genetic disorder, put a spotlight on the difficult role the U.K. judicial system often has to play when children’s lives hang in the balance.