The legal challenges are all the more important because the doctors have lost a common backup plan: going to the United States. The American government, which has long tried to undermine Cuba’s leaders, established a program in 2006 to welcome Cuban doctors, with the aim of exacerbating the island’s brain drain.
But in one of his final attempts to normalize relations with Cuba, President Barack Obama in January ended the program, which had allowed Cuban doctors stationed in other countries to get permanent residency visas for the United States.
“The end of the program was a huge blow to us,” said Maireilys Álvarez Rodríguez, another of the doctors who sued in Brazil. “That was our way out.”
The end of the visa program means that the future of these doctors now rests in the hands of the Brazilian courts. They have mostly ruled against the doctors, but some judges have sided with them, allowing the doctors to work on their own and get paid directly.
The doctors’ defiance puts them at risk of serious repercussions by the Cuban government, including being barred from the island and their families for years.
The seeds of the rebellion were planted a year ago in a conversation between a Cuban doctor and a clergyman in a remote village in northeastern Brazil.
Anis Deli Grana de Carvalho, a doctor from Cuba, was coming to the end of her three-year medical assignment. But having married a Brazilian man, she wanted to stay and keep working.
The pastor was outraged to learn that, under the terms of their employment, Cuban doctors earn only about a quarter of the amount the Brazilian government pays Cuba for their services.
Credit Dado Galdieri for The New York Times
He quickly put her in touch with a lawyer in Brasília, the Brazilian capital. In late September of last year, she sued in federal court to work as an independent contractor.
Within weeks, scores of other Cuban doctors followed Dr. Grana’s lead and filed suits in Brazilian courts. The Brazilian government, which struck the deal with Cuba in 2013 to provide doctors in underserved parts of the country, is appealing the cases that doctors have won and thinks it will prevail.
“There is no injustice,” said Brazil’s health minister, Ricardo Barros. “When they signed up they agreed to the terms.”
Dr. Álvarez said that the stipend offered by the Cuban government to work for a few years in Brazil seemed appealing to her and her husband, Arnulfo Castanet Batista, also a doctor, when they signed up in 2013.
It meant leaving behind their two children in the care of relatives, but each of them would earn 2,900 Brazilian reais a month — then worth about $1,400, and now worth $908 — an amount that seemed enormous compared with the roughly $30 a month Cuban doctors earned at home.
“It was a pretty acceptable offer compared to what we made in Cuba,” Dr. Álvarez said.
So they said goodbye to their children and boarded flights to Brazil, joining the first wave of Cuban doctors greeted at airports with welcome signs and Che Guevara T-shirts.
At the time, Brazil’s leftist government, led by President Dilma Rousseff, saw expanding access to health care as crucial to its goal of building a more equitable society. Flush with cash from a commodities boom, Brazil imported thousands of doctors from Cuba and a few other countries to provide primary care in remote, impoverished areas under a program called Mais Médicos, or More Doctors.
The World Health Organization, a United Nations agency, helped broker the deal. Under it, Brazil pays Cuba roughly $3,620 a month for each doctor, or nearly four times what Cuban doctors earn through the arrangement. Approximately 18,000 Cuban doctors have done stints in Brazil; roughly 8,600 remain in the country.
The United Nations has called the program a success story, noting that it has lowered Brazil’s infant mortality rate and extended care to indigenous communities.
“The More Doctors Project is replicable and would potentially be beneficial in any country that decides to adopt it,” the United Nations Development Program said in a report last year.
Doing so, some Cuban doctors contend, would perpetuate an injustice. Soon after arriving in Santa Rita, a poor village in the northeastern state of Maranhão, Dr. Álvarez and her husband began to feel uneasy about the terms of the contract they signed, particularly after befriending doctors from other countries.
“We began to see that the conditions for the other doctors were totally different,” she said. “They could be with their family, bring their kids. The salaries were much higher.”
Hundreds of miles away, in Minas Gerais State, Dr. Jiménez, 34, found the work rewarding, but also began to harbor feelings of resentment.
“You are trained in Cuba and our education is free, health care is free, but at what price?” she said. “You wind up paying for it your whole life.”
Credit Dado Galdieri for The New York Times
Months before their three-year tour was up last fall, some Cuban doctors who had married Brazilians were offered the chance to extend their stay. Others, including Dr. Álvarez and her husband, were told to prepare to head home.
Cuban doctors unhappy with their situations formed a group on WhatsApp. André de Santana Corrêa, a Brazilian lawyer, said his cellphone began buzzing constantly as Cuban doctors across the country started to text him seeking help.
After analyzing their contracts, Mr. de Santana concluded that the agreements were at odds with the equality protections in Brazil’s Constitution.
Late last year, judges issued temporary injunctions in some cases, granting Cuban doctors the right to remain as independent contractors, earning full wages. One federal judge in the capital denounced the Cuban contracts as a “form of slave labor” that could not be tolerated.
But the federal judge who handled Dr. Grana’s case ruled against her, finding that allowing Cuban doctors to walk away from their contracts posed “undue risks in the political and diplomatic spheres.”
Soon after the first injunctions were issued, Cuban supervisors in Brazil summoned doctors who had filed suits and fired them on the spot, several doctors said. Each was given the chance to get on a plane to Cuba within 24 hours — or face exile for eight years.
Cuban officials did not respond to requests for comment, but a post on the Medical Brigade Facebook page includes an oblique reference to the controversy.
“Many of us seem to have forgotten, when we embarked on this mission, the contract we signed,” the post says. “That’s why you get weaknesses and errors that start eroding the worthy values our parents raised us with.”
When it became clear that a majority of the doctors were losing in court, the WhatsApp group became a place for doctors to strategize and commiserate.
“We keep one another strong,” said Dr. Jiménez, who says she has been unemployed since being fired in June and is now barred from re-entering Cuba for eight years.
Dr. Álvarez and her husband were among the lucky ones to keep their jobs and get what amounted to a huge pay raise. They also managed to bring their children to Brazil.
“It’s sad to leave your family and friends and your homeland,” she said. “But here we’re in a country where you’re free, where no one asks you where you’re going, or tells you what you have to do. In Cuba, your life is dictated by the government.”
Mr. Barros, the Brazilian health minister, said the Cuban doctors should not feel as if they were being poorly compensated, because their salaries were similar to what Brazilian doctors earned during their residencies.
“None of them, to this day, has come to me to complain about their work conditions,” he said.
Mr. de Santana, the lawyer, says he hopes Brazil’s Supreme Federal Court will take up the case. But because Brazil’s top court is so backlogged, a definitive ruling may take years.