There was virtually nothing but rainforest for miles, and then the government agents spotted it: a makeshift shelter, the fire still smoldering. There were two sets of footprints, two machetes and two spots for hammocks.

“He was just here,” said one of the agents, Jair Candor, crouching beneath the shelter in June as his partner snapped photographs. Mr. Candor had spent 35 years searching for a man who did not want to be found — and this time, he just missed him.

That man, Tamandua Piripkura, has lived his life on the run. Not from authorities or enemies — though plenty of people would like to see him dead — but from modernity.

Tamandua is one of the last three known survivors of the Piripkura people, an offshoot of a larger Indigenous group that once spread across a large swath of the forest. He has lived isolated, deep in the Amazon rainforest, his entire life, believed to be about 50 years.

His partner in isolation had long been his uncle, Pakyi, as they trekked through the forest, nude and barefoot, with little more than machetes and a torch. (The third survivor, a woman named Rita, left the land around 1985 and married into another tribe.)

But Pakyi, older and weaker, recently began living near a Brazilian government base in the forest dedicated to protecting the two men. At the same time, Tamandua — seen as the best and maybe only hope for the survival of the Piripkura people — has vanished.

The men are at the center of a larger question that Brazil has been grappling with for years — one that poses major consequences for the future of the Amazon and the native people who have long inhabited it.

Who has the right to the forest? The ranchers and loggers who hold government titles to the land, or two Indigenous men whose ancestors were here before Brazil had a government?

After Mr. Candor first found Pakyi and Tamandua in 1989 — in a tree, foraging for honey — Brazil effectively sided with the loggers. For the next two decades, the government did nothing, and the forest was carved up by sawmills.

Then, in 2007, Mr. Candor found the two men again. The government, under a leftist administration and influenced by shifting attitudes about preserving the Amazon, reversed its stance. Brazil protected nearly 1,000 square miles of forest, an area twice the size of Los Angeles, just for Pakyi and Tamandua.

The protections infuriated the people who owned that land. Decades earlier, the government had sold most of the territory to settlers for almost nothing, part of an effort to encourage Brazilians to exploit the forest and expand the economy. The people who inherited or bought those land titles are now challenging the protections to get back to razing the land and putting cattle on it.

The fight is led by the Penços, a family that runs the state’s largest limestone mines and owns nearly half the Piripkura protected area. Pakyi and Tamandua do not need so much land, they argue, and the government is violating their rights in a veiled effort to stop logging.

“These two Indians are victims, being used as a means to further an environmentalist agenda,” said Francisco Penço, the spokesman for his family, on a recent visit to the forest with his lawyer, their dress shoes covered in mud.

For centuries, Indigenous people were seen as obstacles to progress and slaughtered across the world. But mounting pressure in recent decades has forced governments to protect Indigenous lands. In Brazil, such reserves have become a pillar of efforts to conserve the Amazon. Fourteen percent of the nation — roughly the size of France and Spain combined — is now Indigenous territory.

Yet those territories have remained under constant threat from invaders, and since 2019, almost 800 Indigenous people have been killed. After years of genocide and deforestation, many tribes have just a few dozen members left.

But no known tribe in Brazil is smaller than the Piripkura, according to experts, and now their protections are at risk.

After 15 years of delays, the government aims to complete a study early next year on whether the Piripkura deserve a permanent reserve — or any protections at all.

The Penços and other opponents argue that the protected area should shrink significantly or be eliminated altogether, in part because Pakyi now lives near the government base.

That has made proving Tamandua is alive critical to the safeguards.

So in June, Mr. Candor, 63 and gray-bearded, drove his mud-splattered government truck five hours into the rainforest on a dirt road the Penços built to extract wood. He was heading to the government base to search for Tamandua, whom he had not seen in roughly two years.

Soon after he arrived, a figure appeared at the base’s screen door: a 4-foot-3 Indigenous man covered in red dye from an Amazonian fruit. It was Pakyi.

Pakyi entered cautiously at first, eyeing the newcomers: government agents and New York Times journalists. But he warmed up quickly, smiling wide, grabbing hands and tugging on beards. He had begun wearing clothes, seeing that others did, too. His stained shirt was on backward, displaying its text on his chest: “None of us is better than all of us together.”

While eager to re-enact past hunts, he ignored or refused to answer questions about his family and his nephew.

But a day later, he sat down on a log and began talking. Tamandua is in the forest, he said through a translator, and did not want to be found.

One of the last times Tamandua was seen, in 2017, he and Pakyi walked up to the government base with a simple request: Light our torch.

Mr. Candor had last given them fire in 1998. He believes they had kept it alive since, passing the spark from torch to campfire and back, wrapping the embers in banana leaves when it rained.

Pakyi and Tamandua make hammocks with bark, hunt for tapir with traps and build shelters with the broad palms of the babaçu tree. Yet they no longer make fires, use arrows or farm cassava.

Less than a century ago, the Piripkura lived in a village of more than 100 people, perhaps many more, anthropologists believe, with similar technology as their neighbors: fire, weapons, pottery, crops.

How the Piripkura went from a village to three people is unclear. Anthropologists have pieced together history largely based on stories from the third survivor, Rita, believed to be Pakyi’s sister. She said her family told her things changed when white people arrived.

In the 1940s, the government was handing out land in the Amazon for cheap. “More rubber for victory!” declared a 1943 Brazilian government poster, calling on men to become rubber tappers to aid the Allied war effort.

Many settlers slaughtered Indigenous people. The Brazilian government has acknowledged that during the country’s military dictatorship from 1964 to 1985, at least 8,300 Indigenous people were killed.

In one massacre, a Piripkura village was decimated, relatives told Rita, who is in her 60s. Men dismembered bodies, mutilated genitals and left victims impaled on tree trunks, Rita told government officials.

When Rita and Pakyi were children, their group had just 10 to 15 members left. As one of the few women, Rita was highly coveted. She had two children with a man from another tribe, and when he died from infection, Pakyi and her father propositioned her. “Are you crazy?” she said in an interview. “Marry my father?”

Then came the moment that broke the family apart: Pakyi killed her two children.

Pakyi first killed her older son, who was about 4 or 5 years old, because he was crying, according to Rita and a 2012 government report. Pakyi cut off the boy’s scalp and buried his body, the report said. Later, he carried Rita’s infant daughter into the forest and left her there. Pakyi has never spoken of it, Mr. Candor said, and the government has never investigated the murders further.

Rita fled, running for hours to a cattle ranch called Change Farm where she knew white men lived. It was owned by the Penços.

“I’m surprised when they say ranchers want to kill the Indians,” Mr. Penço said. “We protected Rita when she needed to escape.”

Change Farm was the end of Rita’s isolation. From 1983 to 1985, she worked at the ranch, where she began wearing clothes and speaking Portuguese. An anthropologist’s report also said she was abused and beaten with a broom.

By 1985, she ran away again, eventually ending up with government specialists searching for her tribe. She showed them where her family had lived, but when they arrived, the homes were abandoned.

In 1989, she joined another expedition, this time with Mr. Candor. On the second day, after visiting Rita’s son’s grave, they waded chest-deep through a swamp to an island.

There, they spotted Pakyi and Tamandua looking for honey. Pakyi bolted. Tamandua, in a tree, was stuck.

“He began to tremble,” Mr. Candor said. “And he just asked that we don’t kill him.”

Eventually Pakyi and Tamandua brought Rita and Mr. Candor to their shelter. The group spent two weeks together, and over and over, Mr. Candor asked Pakyi and Tamandua the same question: Where were the others?

“They said they died. Then, in another moment, that they are somewhere out there,” Mr. Candor said. “But they never said where or why or what happened.”

Mr. Candor had officially discovered a new people — a finding that would usually lead to government protections. Yet by the late 1990s, the government had largely abandoned the case.

In 2007, another Indigenous tribe asked the government what had happened to the Piripkura. Mr. Candor was sent to search again.

When he arrived with Rita, the place had been transformed.

“Every direction you went, there were loggers, the roar of chain saws, fallen trees,” Mr. Candor said.

After three months of searching, Mr. Candor and Rita were prepared to give up. Then they heard the pair chatting in the distance. Pakyi and Tamandua were a decade older, but still alive and alone in the forest.

For years, the Penço family had been extracting wood from the area, much of it destined for floors in the United States. The protections, issued in 2008, abruptly halted that business.

The family’s patriarch, Celso Penço, had bought cheap tracts of rainforest from the government decades earlier. When he died in 2016, he left 770 square miles of the Amazon to seven heirs, an inheritance half the size of Long Island. Two-thirds was inside the Piripkura protected area.

The Penços argue that the boundaries are arbitrary and outdated, based on traces of shelters found decades ago. Instead, Pakyi and Tamandua should receive 150 square miles, they say, or a sixth of the current protected area. “Not that we believe these two Indians need that much space,” said one of the Penços’ lawyers, Rodrigo Quintana.

To Mr. Candor, the Piripkura have a stronger claim to the land than the Penços. “If they have the right to all this,” he said of the Penços, “why don’t the guys who were born here, grew up here, lived here and saw their relatives die here?”

Francisco Penço, who is Celso Penço’s son, said the government was changing the “rules of the game” after handing out land. If the government wants it for the Piripkura, it should pay the landowners. His family, he calculates, would be owed $45 million to $70 million.

Mr. Penço also questioned whether the men are truly isolated, pointing out that on several occasions, modern medicine has kept them alive.

In one case, in 2018, Mr. Candor and a colleague carried Tamandua out of the forest because he could not walk. At a hospital, doctors discovered a blood clot in his brain.

Pakyi and Tamandua had seen virtually only each other for decades and, according to anthropologists, believed modern technology came from a deity above the clouds, fetched by white people in planes. Now they were on a commercial flight to São Paulo, Latin America’s largest city, for brain surgery. In the airport, they tried to urinate in the open. On the plane, Pakyi grabbed a woman’s breasts.

They spent 45 days in São Paulo, sleeping on hammocks the hospital hung for them. “They asked to leave the entire time,” said Cleiton Gabriel da Silva, the federal agent who accompanied them. “The city was traumatizing.”

The experience was especially difficult for Tamandua. “Cutting into his head, injecting him all the time, sedating him,” Mr. da Silva said. “He didn’t understand that this was to save his life.”

Shortly after returning, Pakyi began staying close to the government base. He boils small birds the agents catch for him and tries to play soccer, slapping the ball with his hands. He and Rita still have a strained relationship, but each night he sleeps with a stuffed owl she gave him.

Tamandua, however, has disappeared.

So in June, Mr. Candor, accompanied by The Times, went back to the base. There, he found the shelter with the two sets of footprints just a 30-minute walk into the forest.

To him, it was proof that Tamandua was still alive — a finding that could prove crucial to the protections.

Still, the creation of a Piripkura Indigenous reserve could save this part of the forest, but may not save the Piripkura.

Several years ago, Mr. Candor brought Pakyi and Tamandua to the village of another Indigenous group that spoke a similar language. Mr. Candor hoped to inspire them.

Anthropologists would consider any offspring from the two men another Piripkura generation. He does not think Pakyi, with his age and temperament, will procreate. But he believes Tamandua can.

“If there was a spark between him and one of the girls there, for sure,” Mr. Candor said. But in the village, the women were more interested in their smartphones.

“Wrapped up in technology,” he said, “they’re not going to want to come to this life here, roaming the forest.”

As for Rita, much of the rainforest where her family once lived has been razed, and so has the sacred area where her people, including her, gave birth.

If there was going to be another Piripkura birth, she said, it was up to one person: Tamandua.

“We have to find him,” she said.

Lis Moriconi contributed research from Rio de Janeiro.