When the summer started, transgender-rights supporters were riding a courtroom winning streak.

In state after state — Indiana, Florida, Kentucky and Tennessee — civil rights lawyers persuaded judges to block limits on transition care for minors. They won in front of judges appointed by Barack Obama, and in front of others appointed by Donald J. Trump. They won in state court in Missouri, and in federal courts in Alabama and Arkansas.

But after a run of early rulings favorable to transgender plaintiffs, recent months brought a series of setbacks.

Republican-appointed judges in two federal appellate circuits ruled against plaintiffs and allowed states to start enforcing bans. Efforts to challenge restrictions under state constitutions also faltered, with judges in places like Nebraska and Texas allowing new limits to take effect.

The political and legal chaos is likely to be resolved by the U.S. Supreme Court, which currently has a 6-to-3 conservative majority and has long been an arbiter on questions of the rights of L.G.B.T.Q. people.

In the meantime, transgender minors across the country are left in limbo, unsure if they will be able to fill their next prescription for puberty blockers or hormone therapy.

Whether the laws are allowed to stand nationally will depend largely on how federal judges parse competing arguments about 14th Amendment protections, parental rights and state rights.

Plaintiffs opposed to bans have invoked two of the U.S. Constitution’s most famous and most litigated clauses — the 14th Amendment’s guarantees of due process and equal protection — in making their claims.

Those clauses have been at the center of some of the Supreme Court’s most famous opinions, on cases that desegregated schools, allowed interracial marriage and established a national right to abortion.

All year, medical care for transgender children has been at the center of political debates. Legislators in around 20 Republican-led states passed bans or sweeping restrictions on transition care for minors. After losing repeatedly in statehouses, supporters of transgender rights filed lawsuits in at least 14 states to convince judges that transition care was safe and effective.

Rulings keep emerging from courthouses, leaving an uncertain landscape. Last week in Montana, where a ban was set to go into effect over the weekend, a state judge sided with young plaintiffs who presented the debate as a matter of life and death. In Nebraska, sweeping new restrictions went into effect on Sunday. And in Arkansas, where a ban was blocked by a federal judge, state officials are trying to fast-track their appeal.

Plaintiffs have argued that gender-transition treatments can alleviate the distress that many transgender minors experience during puberty. Decisions about whether to pursue this care, they contend, should be made by patients in consultation with parents and medical experts — not by politicians.

But Republican attorneys general have asserted that states have a legitimate interest in regulating medical care. Minors, they argue, lack the maturity to consent to treatments that can have irreversible consequences, including infertility. The laws are believed to affect thousands of transgender children across the country, though no comprehensive data is available.

L.G.B.T.Q. groups regard courtrooms as fairer venues than statehouses for this debate.

“There has never been a need for quite the volume of litigation that the L.G.B.T.Q. legal advocacy organizations have had to pull together in short order,” said James Esseks, a lawyer for the American Civil Liberties Union who played a leading role in the fight to legalize same-sex marriage. He added: “This is a degree of crisis we’ve not seen before.”

The field of transition care for minors is relatively new, and prominent clinicians have disagreed on issues such as the ideal timing and diagnostic criteria for these treatments. Major medical organizations, including the American Academy of Pediatrics, support such care for young people and have said that bans pose serious health risks.

But several European countries with nationalized health care systems have recently limited which children can receive gender-related medications, after reviews of the research showed uncertainty about the evidence for their effectiveness in adolescents.

“What the Indiana General Assembly has decided to do is say, ‘We don’t want our children to be part of this grand experiment,’” the solicitor general of Indiana, Thomas M. Fisher, told a federal judge in June when he argued against an injunction on the ban that was signed into law this year.

Nine of the lawsuits challenging limits have been filed in federal court, while five have sought to overturn restrictions through state courts. Most cases remain in very early stages, with trials still months away. Only one case, in Arkansas, has been decided on its merits, with a federal district judge there permanently blocking enforcement, pending appeal.

While federal district judges appointed by Democratic presidents have ruled in favor of plaintiffs, those appointed by Republicans have been split in their views. Several injunctions have been undone in recent weeks by conservative jurists on appellate panels in the Sixth and 11th Circuits.

The plaintiffs are asking judges to find that the new laws amount to sex discrimination because they single out transgender minors, barring them from receiving puberty blockers and hormone therapy while other children can still get those prescriptions to treat early or delayed puberty. Lawyers for the states have countered that the bans do not discriminate based on sex because they apply to transgender boys and girls.

Each side has found reason for optimism in recent rulings. In 2020, the Supreme Court found that a civil rights law protected gay and transgender Americans from workplace discrimination. But conservatives see an opening to uphold transition-care restrictions through the court’s most famous recent opinion, Dobbs v. Jackson Women’s Health Organization, which overturned Roe v. Wade and allowed states to ban abortion.

In an opinion in August that allowed Alabama’s transition care ban to take effect, Judge Barbara Lagoa of the federal appeals court in Atlanta said the Dobbs decision required judges to weigh whether a right was deeply rooted in the country’s history when determining whether a law could be challenged based on the 14th Amendment’s due process clause.

Judge Lagoa, who was appointed by Mr. Trump, also seemed to suggest that a ban on transition care for adults, which no state legislature has yet passed, might be constitutionally defensible. She wrote that “the use of these medications in general — let alone for children — almost certainly is not ‘deeply rooted’ in our nation’s history and tradition.”

Beyond the 14th Amendment arguments, the cases also highlight the tension between parental rights and state rights — both principles that conservatives have often championed on other matters.

The plaintiffs have argued that legislators have no business banning treatments recommended by doctors and agreed upon by children and their parents. But Republicans have responded by saying that states have a duty to regulate medical care, particularly for procedures that they consider harmful, and that the federal judiciary should not contradict the wishes of elected lawmakers.

The lawsuits around transition care for minors represent only a fraction of ongoing litigation on transgender issues. Other cases deal with bathroom access, sports participation and Medicaid coverage for transition care.

Sasha Buchert, an attorney at Lambda Legal, which advocates L.G.B.T.Q. equality, said past litigation helped to build public support for same-sex marriage and openly gay people serving in the military.

“The most important lesson I draw from that work is the importance of shifting public opinion by humanizing trans folks,” said Ms. Buchert, who is transgender.

As Republicans in state after state took up bills this year to restrict transition care, transgender-rights supporters found themselves on the defensive.

Montana’s debate turned particularly acrimonious after Representative Zooey Zephyr, a Democrat and the first openly transgender woman elected to that Legislature, was censured in April after an impassioned speech opposing the ban.

Once Gov. Greg Gianforte, a Republican, signed the bill into law, saying it was vital to “protect young Montanans from these permanent, life-altering procedures,” lawyers from the A.C.L.U. and Lambda Legal sued in state court.

While their arguments mirror those being put forward in federal courts, the plaintiffs chose to fight the ban under Montana’s Constitution, which gives parents broad rights over the medical care of their children and sets a high bar for the government to interfere with health care decisions.

Lawyers for the state said transition care for minors relied on “deeply flawed and disputed science.” There was little harm, they argued, in making young people wait until they turned 18 to receive treatment.

Phoebe Cross, a 16-year-old transgender boy in Bozeman, Mont., vehemently disagreed. Starting testosterone therapy a year ago, he said in an interview, eased feelings of distress and depression so severe that they led to thoughts of suicide.

“Testosterone was the light at the end of the tunnel,” said Phoebe, who is among the plaintiffs in the Montana lawsuit.

But starting treatment was not an easy choice for him — or for his parents, Paul and Molly Cross, who are also plaintiffs.

Phoebe struggled with anxiety and depression for years, but it was only in 2021 that the Crosses began to grasp that gender identity was the root of the problem.

A gender specialist they consulted raised the possibility of starting Phoebe on testosterone therapy. His parents, who are conservation scientists, had lots of questions and concerns. How many people changed their minds after starting these treatments? What were the side effects? Was there solid data on patient outcomes?

“The regret piece was our biggest concern,” Molly Cross said.

Ultimately, they deferred to Phoebe, and were relieved to see a dramatic turnaround in their child’s mood and outlook as his voice deepened, hair began growing on his chin and his muscle mass increased. Suddenly, laughter and joy returned to their home.

“It’s changed my life,” said Phoebe, who intends to go to medical school. “I’m such a confident person now.”

Their experience felt incongruous with the political debate, in which parents have often been portrayed as enablers of unwise treatments.

“It’s not an easy life,” Paul Cross said. “What parent wishes that their child had a ton of challenges in their lives?”

Katherine Mistretta, a nurse practitioner in Bozeman who oversees Phoebe’s care, said she decided to become a plaintiff in the lawsuit because treating transgender people for a decade convinced her that the medical care was vital.

“You see a shell of a person on that first visit who is terrified and fearful and feels disconnected from their bodies, and when you start addressing the issues at hand you see people blossom,” said Ms. Mistretta, one of a handful of medical professionals in the state providing transition care to young people.

In recent weeks, she and the other Montana plaintiffs had been nervously watching to see whether a judge would allow the ban to take effect on the first day of October.

In blocking the ban last week, Judge Jason Marks issued a sharply worded ruling concluding that the legislative debate over the law had been “replete with animus toward transgender persons” and that its enforcement would cause “irreparable harm.”

The ruling is temporary, and an appeal is expected. As in other states, a final resolution could take years.