Tiffany Hsu / Los Angeles Times

There may be hope for Twinkies after all: Hostess Brands Inc. and its striking union agreed to a mediation that will forestall the company’s planned liquidation for the time being.

At a bankruptcy court hearing Monday in New York, 82-year-old Hostess had planned to ask permission to start shutting down its business. Instead, Judge Robert Drain urged the company and the Bakery, Confectionery, Tobacco Workers and Grain Millers International union to consider mediation.

Both sides agreed to try to work through their conflict, which would preserve more than 18,000 jobs that will otherwise disappear if the Irving, Texas-based company closes its doors. Mediation hearings will begin in private today.

The hearing to consider Hostess’ motion to wind itself down is adjourned until Wednesday morning, according to the company. Production “remains shut down,” it said.

Hostess has 565 distribution centers around the country, as well as 33 bakeries and 570 bakery outlets.

On Friday, Hostess said it would go out of business, blaming a strike by members of the BCTGM union. Workers who walked out accused the company of slashing benefits and wages while rewarding managers with substantial pay raises.

Within days, a suite of suitors emerged, vying to control brands such as Ho Ho’s and Ding Dongs.

“There’s a whole host of huge food companies out there that have the financial wherewithal to take over the Twinkies brand and make money off of it,” said Anthony Michael Sabino, a business professor at St. John’s University. “There could be very spirited bidding.”