Court demands investigation into early releases of jailed politicians