(Adds details on unit, valuation)
By Marta Nogueira
SAO PAULO, Jan 31 (Reuters) - A Brazilian federal court rejected an appeal by state-run oil firm Petrobras and upheld a decision blocking the company's plan to sell a stake in fuel distribution unit BR Distribuidora, according to a court document seen by Reuters on Tuesday.
The proposed sale of a stake in Petrobras Distribuidora SA was seen as an important step toward the company's goal of a combined $21 billion in divestments in 2017 and 2018. Petrobras expected to sell a controlling stake in the company by the middle of this year.
Analysts at UBS Securities had estimated BR Distribuidora to be worth around $10 billion.
The court decision came in a lawsuit by an oil workers union in the northeastern state of Alagoas.
The same union has also challenged other Petrobras asset sales, such as the divestment of petrochemical units Suape and Citepe, which Mexico's Alpek agreed to buy for $385 million. (Reporting by Marta Nogueira; Writing by Marcelo Teixeira and Tatiana Bautzer; editing by Diane Craft and Dan Grebler)