RIO DE JANEIRO (Reuters) - A Brazilian judge on Thursday accepted a request for bankruptcy protection from former billionaire Eike Batista's oil company, OGX (>> OGX Petroleo e Gas Participacoes SA), but denied the same protection for two small foreign subsidiaries in a potential setback for the company.

Rio de Janeiro Judge Gilberto Matos granted bankruptcy protection for the company's Brazil-based units OGX Petróleo e Gás SA and OGX Petróleo e Gas Participações SA.

OGX sought court protection from creditors on October 30 after it failed to convince them to refinance more than $5.1 billion in obligations, in Latin America's largest-ever corporate bankruptcy filing.

Marcio Costa, a lawyer for OGX, told Reuters the decision to deny protection for two foreign units would complicate the recovery process, adding that the company plans to appeal the ruling.

"This decision disrupts the judicial recovery process, allowing some lenders to seek debt payments in Brazil and Austria," Costa said. "Those funds were raised abroad to be used in Brazil. The judge didn't take that into consideration."

OGX has two foreign subsidiaries, OGX Internacional and OGX Austria. The judge denied the request for those units on grounds bankruptcy protection should be decided in the countries where they are based, according to a copy of the judge's decision.

"This would have created legal uncertainty for international creditors who would have not been allowed to go on trial for their credits under our legislation," Matos said.

For the Brazilian operations, the judge's decision gives OGX 60 days to come up with a restructuring plan. OGX creditors including California-based bond fund Pacific Investment Management Co (PIMCO) and New York-based investment fund BlackRock Inc (>> BlackRock, Inc.) will then have 30 days to endorse or reject the plan.

OGX's sister company shipbuilder OSX Brasil SA (>> OSX BRASIL SA) filed for bankruptcy protection on Nov 11. The company is also expected to get court protection from creditors.

Batista, 56, a dealmaker who once boasted he would become the world's richest man, has seen his personal fortune plunge by more than $30 billion in the last 18 months as investors punished the share price of his listed companies.

The collapse of his empire stems from the failure of OGX to meet its ambitious oil production targets despite repeatedly reassuring investors that copious amounts of oil would soon flow.

The downward spiral forced Batista to start breaking up his Grupo EBX conglomerate, which also included port, mining and energy interests.

Next week OGX's board is expected to change the name of the company to remove the trademark letter X that stood for "multiplication of wealth" and branded all the companies in Batista's now-crumbling industrial empire.

For the court's decision, in Portuguese, click on http://r.reuters.com/cuk84v .

(Reporting by Sabrina Lorenzi; Writing by Alonso Soto; Editing by Gary Hill, Steve Orlofsky and Andrew Hay)

By Sabrina Lorenzi