What can one do in such a situation to recover control over the
domain?
Domain registration statuses akin to "Client Transfer Prohibited" displayed in a WHOIS record simply mean the domain is locked to protect against unauthorized changes at the registrar level.
The first step is for the registrant to unlock the domain with the current registrar, who's domain control panel should still be accessible. Next, they should initiate a transfer to another ICANN-Accredited Registrar. This will require authorization sent automatically to the email address contained in the registrant's contact information, so make sure that's up-to-date.
but you can't just transfer a locked domain to another registrar
without some participation from the other organization
If the registrar fails to unlock the domain or initiate the transfer within a reasonable amount of time you can submit a Transfer Complaint as covered here by ICANN: About Locked Domain
Each accredited registrar, and reseller there-under, is bound by a Registrar Accreditation Agreement (RAA). Under that agreement, registrars must permit inter-registrar transfers to other registrars within a specific time-frame, with the exception of certain limited circumstances.
Domain registrants also have certain rights under the RAA. If a registrar either refuses or ignores your request to transfer your domain, or otherwise violates your Registrant Rights, you can also file a Contractual Compliance Complaint with ICANN.
Businesses can declare bankruptcy but still continue to operate. Often this is done to restructure debt, and in some cases, they may do this prior to being purchased by another company. So the registrar may be in the process of being acquired by another company, under which the registrar may continue to function.
When a registrar completely goes out of business however, ICANN will make provisions with the registry for the domain extension(s) that it oversees to be transferred to another ICANN-Accredited Registrar. This usually occurs automatically and transparently, so registrants will not have to transfer their domain(s) unless they chose to.