Hostess Brands Inc. must return to a “liquidation scenario” after mediation with its bakers’ union failed to avert a shutdown that would eliminate more than 18,000 jobs, the judge overseeing the company’s bankruptcy said.

U.S. Bankruptcy Judge Robert Drain said today at a hearing in White Plains, New York, that company and union officials acted in good faith in yesterday’s talks. Hostess is asking Drain for permission to close its facilities and take steps toward selling assets. Most of the wind-down would take place in the first three months, a company lawyer told Drain.