A major South American infrastructure deal is in the works as China’s prime minister tours the region this week. Beijing is hoping to back and build an ambitious interoceanic railway between Brazil and Peru that could make for faster, cheaper transportation of local commodities to resource-thirsty Chinese markets. It’s an unprecedented project in Latin America that’s already raised some flags over environmental and human rights risks, and analysts say it could be the biggest test yet of China’s growing relationship with the region.

The proposed rail link, known as the Twin Ocean Railroad, would connect Porto do Açu, a Brazilian Atlantic port, with Peru’s Puerto Ilo on the Pacific Ocean through some 3,300 miles (5,300 km) of rail. The railway is expected to cut transportation time and reduce the cost of shipping grain from Brazil to China by about $30 a ton, Brazilian officials told Reuters last year. China is a major trading partner for both countries: Brazil is a top exporter of iron ore and soybeans to China, while the biggest share of Peruvian exports -- primarily minerals like gold and copper -- also goes to Chinese markets.

Chinese President Xi Jinping jump-started discussions on the railroad during his trip to Latin America in summer 2014, and the three countries signed a memorandum of understanding on it in November. Brazilian President Dilma Rousseff and Chinese Premier Li Keqiang, who is visiting four South American countries this week, announced Tuesday that they would be starting feasibility studies on the project.

The rail line is estimated to cost $10 billion and reach completion in six years; around 2,000 miles of it will run through Brazil. It’s not yet clear who would build it: the Associated Press reported that Brazilian firms would likely take on the construction, but Chinese companies can bid to work on some sections of the rail line, too.

There are high financial hopes for the deal. China, currently facing an economic slowdown, would be able to access raw materials more efficiently and at a lower cost if the railway is successfully completed. It could also be a major boost to Latin America’s sluggish economies, said Kevin Gallagher, an associate professor of global development policy at Boston University who has focused on the China-Latin America relationship.

“Latin America will benefit the most if this is done right,” he said. “High-speed rail could help get products to the Pacific, which is a growing destination for Latin American exports, but it could also facilitate trade among Latin American countries themselves.”

Infrastructure investment is sorely lagging in the region right now. The United Nations Economic Commission for Latin America estimated that Latin American countries need to spend 6.2 percent of GDP on infrastructure a year – or around $320 billion – to meet infrastructure demands in the next decade. Current investment levels stand at just 2.7 percent of GDP, the commission said.

The rail discussions are just part of an expected $50 billion worth of investment and infrastructure deals Premier Li is expected to sign in Latin America this week. China’s been noticeably deepening its economic relationship with the region through loans and investment deals as it seeks to diversify its relationships. And Latin America, which the International Monetary Fund predicted would only grow by less than 1 percent this year, is welcoming the funds.

But the railway is “really a test case for the China-Latin America relationship,” Gallagher said. “If it’s done right, a high-speed railway with high-level engineering, a minimal amount of environmental damage and engagement with local communities is going to be a win-win all around. But it could also be the complete opposite.”

As the plan accelerates, environmental and civil society groups are already sounding alarm bells over the proposed route, which would cut through the Amazon rain forest and run through lands occupied by indigenous and protected groups. The Amazonian Network of Georeferenced Socio-environmental Information, a Brazilian environmental group, estimated that the project could leave 600 indigenous communities vulnerable. The rail line is also planned to run through heavily forested areas as both Brazil and Peru grapple with surges in deforestation.   

“This is a very controversial project,” said Julia Mello Neiva, a Brazil-based researcher for the Business and Human Rights Resource Centre. “Considering what we have seen in past years in Brazil with the impact of big infrastructure projects, it’s hard to say whether this would really be good for the country.”

Brazil is still witnessing fallout from the Belo Monte dam, a hydroelectric megaproject that’s faced years of backlash from indigenous groups who say they weren’t consulted or fairly compensated before the dam displaced them. Protests forced several project delays, resulting in millions of dollars lost and deep mistrust of the government by local communities.

Another Chinese-financed megaproject in Latin America, the Nicaragua interoceanic canal, has already attracted mass protests over land rights and fears of environmental degradation. There are clear differences between the two projects: Unlike the canal, the railway has explicit backing from the Chinese government, which has had experience with infrastructure projects abroad, and it’s not dealing with an existing direct competitor like the Panama Canal. But outcry over the canal, much like the response to the Belo Monte dam, is a warning of what could happen with the railway if China, Brazil and Peru can’t deftly handle environmental and human rights concerns.

Neiva expects protests to start cropping up against the railway as the plans unfold. But she said there is still room for environmental and human rights groups to be a part of the discussion and ensure that governments and companies take their concerns seriously.

“China has already been operating in lots of other countries and had lots of problems by not respecting social and environmental protections, so I think there is room for civil society groups to try to engage and make sure that there will be meaningful consultations at every stage,” she said.

Latin American governments’ handling of the situation will be just as crucial to monitor. With slow economic growth and declining Chinese demand, “the countries are a little desperate, and when they’re desperate they tend to cut corners,” Boston University’s Gallagher said. “But let’s hope that everyone takes a long term view here, because this project’s going to be here for a long time.”