(Adds new cabinet to be sworn in Thursday afternoon)
By Lisandra Paraguassu and Anthony Boadle
BRASILIA, May 11 (Reuters) - The Supreme Court rebuffed a last-ditch bid by President Dilma Rousseff to halt a vote in the Senate on Wednesday that is expected to put her on trial for breaking budget laws and end 13 years of leftist rule in Latin America's biggest country.
If her opponents garner a simple majority in the 81-seat Senate in a session that will last late into the evening, Rousseff will be replaced on Thursday by Vice President Michel Temer as acting president for up to six months during the trial.
There were signs Rousseff was preparing for defeat: she plans to dismiss all her cabinet and has given instructions that there should be no easy transition for a Temer government because she considers her impeachment illegal, presidential aides said.
With a change of government imminent, Temer plans to swear in new ministers on Thursday afternoon, Senator Romero Jucá, head of his Brazilian Democratic Movement Party (PMDB), told reporters.
Rousseff, who has been in office since 2011, has seen her popularity crushed by Brazil's worst recession since the 1930s and a two-year probe into a vast kickback scheme at state-run oil company Petrobras.
The prospect of business-friendly Temer taking power has driven Brazilian financial markets sharply higher this year, on hopes he could cut a massive fiscal deficit, restore investor confidence and return the economy to growth.
The political crisis has deepened Brazil's recession and comes at a time when Brazil hoped to be shining on the world stage as it prepares to host the Olympic Games in Rio de Janeiro in August.
A Supreme Court judge denied an injunction Rousseff sought on Tuesday to halt the Senate vote. Justice Teori Zavascki rejected as "legally implausible" the government's argument that impeachment was flawed because it was started out of revenge by the former speaker of the lower house.
In a momentous session followed by many Brazilians live on television, each senator was given the chance to speak. A final vote could take place after midnight (0300 GMT on Thursday).
Brasilia-based consultancy ARKO Advice projected that the upper chamber would vote 57-21 to try Rousseff. The figure amounted to 78 votes rather than 81 due to absences and abstentions.
That would indicate Rousseff's opponents may already have the two-thirds of the vote needed to convict her at the end of the trial and remove her definitively from office. If that happened, Temer would then fulfill the remainder of her mandate until elections in 2018.
Rousseff, 68, was chairwoman of Petrobras at the time when much of the graft occurred, but she has not been accused of corruption. She stands charged with manipulating government accounts to disguise the size of Brazil's fiscal deficit to allow her to boost public spending during her 2014 re-election campaign, a practice employed by previous presidents.
The president's plan to dismiss all her cabinet if and when the Senate suspends her will force Temer to hit the ground running, since he was counting on a gradual transition to a new cabinet.
Two Rousseff aides said, however, that the dismissal of her cabinet would exclude Central Bank Governor Alexandre Tombini, and the current sports minister, who is scrambling to prepare for the Rio 2016 games.
'TIME FOR HER TO GO'
Senate leader Renan Calheiros, of Temer's PMDB party, said he would not vote to remain neutral. But he was already using the past tense to refer to Rousseff's presidency.
"Temer needs the backing of Congress to carry out deep reforms, above all reform of the political system, if he becomes president," he told reporters.
Opinion polls show an overwhelming majority of Brazilians want to see Rousseff impeached. But the surveys also indicate scant popular support for the 75-year-old Temer.
"I voted for Dilma, I believe in her as a leader, but I also think she has done such a bad job that it is time for her to go," said Leticia Britto, a 23-year-old business student from Sao Paulo, visiting Brasilia. "The best way forward would be to call for new elections."
Leaning toward a liberal economic policy, Temer has picked former central bank chief Henrique Meirelles to be finance minister and Itau Unibanco's chief economist Ilan Goldfajn as head of the central bank.
"Temer may enjoy a honeymoon with markets for some weeks, maybe months, but when investors come to realize that the fiscal results will not improve fast enough, then we could see some disappointment later this year," said Bruno Lavieri, an economist with consultancy 4E, in Sao Paulo.
DENOUNCING A 'COUP'
Rousseff, the first woman to lead Brazil, has denied committing any crime that warrants impeachment charges. A former member of a Marxist guerilla group who was tortured during Brazil's 1964-1985 military dictatorship, she has called her impeachment a 'coup' and vowed to fight the process until the last minute.
"I will not resign, that never crossed my mind," Rousseff said in a speech on Tuesday, to cheers from supporters.
There are worries that the tense political situation may spark protests that could turn violent after anti-impeachment protesters blocked roads with burning tires in several cities on Tuesday. Rousseff's Workers Party and labor unions have called for a national strike.
Rousseff's stance that democracy is under attack has won sympathy among some of Brazil's leftist neighbors. The U.S. government said it hoped the country pulls through the crisis.
"Brazil is under some scrutiny and under some pressure," White House spokesman Josh Earnest said in Washington. "We continue to have confidence in the mature, durable democratic institutions in Brazil to withstand the challenge."
Pope Francis, in his general audience on Wednesday at the Vatican, said he was praying for harmony and peace in this "time of difficulty" for Brazil.
The last time a Brazilian president was suspended from office was in 1992, when President Fernando Collor de Mello was placed on trial for corruption. He resigned from office shortly before he was found guilty by the Senate.
(Additional reporting by Alonso Soto, Marcela Ayres, Brad Brooks and Silvio Cascione; Editing by Frances Kerry and Andrew Hay)