The mediator is paid by the parties. Sometimes, the lawyers would advance the cost of mediation on behalf of their clients, but it’s ultimately up to the parties to pay their lawyer or pay the mediator directly. The amount of the party pays depends upon the number of parties participating in mediation.
If there are two parties, those parties split the mediators bill equally. If there are more than two parties, then they split the mediators bill in their proportionate share.