Voting-rights advocates and Democrats, who have been disadvantaged the most by gerrymanders in recent years, say they will continue the fight by other means. The National Democratic Redistricting Committee, led by former President Barack Obama and his attorney general, Eric H. Holder Jr., has targeted state-level political offices in a dozen states this year, aiming to increase Democratic control of statehouses before the next round of redistricting in 2021. The group has also joined lawsuits claiming racial gerrymanders of House districts in Alabama, Georgia and Louisiana, and is mounting grass-roots efforts to enact electoral reforms.

The group and its affiliates have raised $29 million since its start in January 2017. “This is losing a battle. It’s not losing the war,” the group’s executive director, Kelly Ward, said. “There are a lot of fronts in this war, and we intend to fight on all of them.”

Yet one of the most promising anti-gerrymander efforts may also be among the most imperiled. Ballot initiatives to reduce or eliminate political control over redistricting will come before voters in at least four states in November, and possibly as many as six. Six other states already have independent redistricting bodies; citizen support for new commissions appears in some states to be strong.

But the justices have been divided on whether such measures are constitutional. Here too, Justice Kennedy’s retirement may prove to be pivotal.

In 2015, the Supreme Court rejected a claim by Arizona’s Republican-led Legislature that the Constitution gave it sole authority over redistricting, and that a ballot initiative that shifted the task to a nonpartisan citizens commission was illegal. Justice Kennedy joined the court’s four liberals in the 5-4 ruling. Chief Justice Roberts wrote the dissent for the court’s conservative wing.

“That case really got Justice Roberts exercised,” said Richard L. Hasen, a law professor and election-law expert at the University of California-Irvine. “It was one of the more forceful dissents he has written.” In a court where hard-line conservatives are dominant, he and others said, the constitutionality of citizen redistricting commissions might well get a second and less favorable look.

The next legal challenge to partisan gerrymanders likely will come next year from North Carolina, where a three-judge panel ruled in January that the state’s 13 House districts were an unconstitutional partisan gerrymander