BRASÍLIA, Brazil — When a Brazilian Supreme Court justice blocked the publication of an article about corruption that named a fellow judge, the backlash on social media was swift. Three days later, the justice backtracked and struck down his own decision.

But this and other recent decisions left many worried that the court’s actions were eroding its credibility, hampering its ability to function as a check on government just as the country inaugurated a far-right president, Jair Bolsonaro, who has expressed a disregard for civil liberties.

Mr. Bolsonaro has attacked the news media and voiced admiration for regimes that relied on censorship and repression, such as the dictatorships in Brazil and Chile.

Preserving the court’s role as a “moderating power” in this context is particularly important, said Conrado Hübner, a constitutional law professor at the University of São Paulo.