It could just be capped at the lower of what the two legal teams charge. Both should have to submit their bills to the court, whichever charged less is the cap on what the loser has to pay for the other party's legal fees. That way each party is at most on the hook for twice what they paid their own legal team, assuming no other damages or penalties.
This is gameable (for instance by disclosing millions of unrelated pages of content during discovery). All you really need is for the judge to look at how much each legal team charged for what and make a ruling on what's reasonable for the loser to pay and what isn't.