remember War of the Roses, no one wins, its just a degree of losing. legal costs in equity actions, which is what yours was, are high. this should have been explained to you by your legal team when you first consulted them.
if it was, as you say a lose/lose situation, perhaps you should have considered optione before the case went as far as it did.
anyway, you are now faced with legal bills. if you must pay them, then you must pay them, but the other side, and yoru own side, should accept installments.
Alternatively, they may seek a lump sum, but smaller than the bill, if you must take out a loan to pay.