A British court has ruled that a 14-year-old boy who sued his parents after being sent to boarding school in Ghana must remain there until he completes the equivalent of his GCSEs.