The ruling sets up a situation in which the state Supreme Court will weigh in on an election that could expand the GOP’s current 5-2 majority among the justices.