They had tried to reverse a ruling that would allow the popular President Rafael Correa to hold a referendum that would weaken Congressional powers.