RIO DE JANEIRO, Dec 23 (Reuters) - Brazil's small- and medium-sized oil firms are set to invest some 40 billion reais ($7.74 billion) in onshore fields by 2029, according to a survey by the country's independent oil and gas producers association Abpip.

The group, which includes companies such as Eneva and PetroReconcavo, aims to extend the lifespan of and increase production at land oilfields acquired from state-run Petrobras in recent years.

The move to buy fields from Petrobras has boosted the onshore oil and gas industry in Brazil. Petrobras had sidelined some assets after shifting focus to developing its prolific pre-salt fields, Abpip's executive secretary, Anabal Santos, told Reuters.

The purchases from Petrobras have boosted investments, production and taxes, Santos said, arguing that even with leftist Luiz Inacio Lula da Silva's incoming government, the trend is not likely to reverse.

Santos said that production in onshore basins had been in decline since 2012 and began to increase "substantially" as new companies entered the market.

Output from onshore fields is now expected to increase to 500,000 barrels of oil equivalent per day by 2029, up from 150,000 in 2016, he said.

"We are convinced that common sense will prevail" in the new government, Santos said. "This process (of Petrobras selling assets) should be expanded in shallow waters," he argued.

The state-run firm has already sold some offshore assets, Santos said.

Since Petrobras started its divestment strategy in 2013, it has sold 204 concessions for oilfields; 165 of which are onshore and 39 offshore.

With the upturn of the onshore industry, more business is expected, the oil firms surveyed believe. In addition to the Petrobras sales, regulator ANP could auction oil-bearing areas and private companies could strike up agreements.

"We don't only live off of Petrobras' divestment program... we can make acquisitions, partnerships, 'farm in'... We're just getting started," Petroreconcavo's chief executive Marcelo Magalhaes told Reuters. ($1 = 5.1655 reais) (Reporting by Marta Nogueira; Writing by Peter Frontini; editing by Diane Craft)