The ruling prevents the country's first Indigenous president from contesting elections scheduled in August 2025.