RIO DE JANEIRO — The indigenous leaders had a plan. They would unite for a last, desperate stand against the mammoth dam threatening their lands in the Amazon, vowing to give their lives, if necessary, to prevent it from being built.

“This will be our last cry for help,” said the chief of the Arara tribe, José Carlos Arara, after a meeting of leaders from 13 tribes last month. “We are not here to kill. We are here to defend our rights.”

For a moment this week, it looked as if they had won an unexpected reprieve. On Wednesday, a federal judge in Para State, where the third largest dam in the world would be built, halted the government’s April 20 auction to award contracts for its construction, saying the project could cause “irreparable harm” to indigenous peoples.

But by Friday, the dam was back on the table. A judge in the capital, Brasília, overturned the ruling and said the auction would take place as scheduled.