By Alexandria Sage and David Shepardson

SAN FRANCISCO/WASHINGTON (Reuters) - A lawyer for Volkswagen AG <VOWG_p.DE> said at a court hearing Thursday the German automaker believed it could fix 85,000 polluting 3.0-liter VW, Audi and Porsche diesel cars and SUVs, a move that could help the company avoid a second pricey vehicle buyback.

Separately, a Justice Department lawyer, Joshua Van Eaton, said discussions and tests were being conducted to resolve the fate of those vehicles, which could take months to rectify.

At the hearing, U.S. District Judge Charles Breyer did not set a formal deadline to fix those vehicles, but set an Aug. 25 status hearing to get an update.

Earlier this week, VW agreed to spend up to $10.033 billion to buy back 475,000 2.0-liter diesel cars that emit up to 40 times the allowed level of pollution, and fix them if regulators approve it. VW also agreed to spend $4.7 billion on zero-emission vehicle efforts and diesel offset programs and $603 million to settle lawsuits with 44 U.S. states.

If VW were required to buy back the larger, more expensive 3.0-liter vehicles, it could add billions to its costs.

VW lawyer Robert Giuffra said the automaker believed the 3.0-liter vehicles were fixable and that the fix will not be "complicated" or negatively impact the vehicles' performance.

The testing is to ensure the durability of the proposed fix, he said.

"The company believes that we can fix the 3.0 liter to the standards to which those cars were originally certified," Giuffra said.

Van Eaton said the talks were highly technical and it "takes time to be fully confident that whatever is being proposed is a technically sound solution."

Environmental Protection Agency spokesman Nick Conger said the agency continues "to investigate the problems with the 3.0 liter diesel vehicles. We want to get it right, so we will explore solutions that are technically sound and a fair deal for consumers."

He did not say if EPA is pursuing a buyback offer for 3.0 liter owners.

Breyer will hold a July 26 hearing on the 2.0-liter agreements and could grant final approval to start buybacks early as October.

The 3.0-liter vehicles did not have the same "defeat device" that the 2.0-liter vehicles used but had undeclared auxiliary emissions-control devices that allowed them to emit up to nine times the legally allowed level of pollution, much less than the 2.0-liter vehicles.

VW has been barred since November from selling new diesel 3.0-liter vehicles in the United States.

The vehicles at issue include diesel vehicles from the 2009-2016 model years, including the Volkswagen Touareg, Porsche Cayenne Audi A6 and A7 Quattro, Audi A8 and Audi Q5 and Q7.

(Editing by Bernadette Baum and Bernard Orr)