It depends on the specific situation. A lawyer can represent his client through all the stages of the mediation process or only a part of it. Many people choose to solve their problems in mediation without having to hire a lawyer or receive their advice.
As an attorney, I can provide legal information (but not specific legal advice on the case to any of the parties), and write the documents in which the agreement is made.
In any case, I will analyze with you from a practical point of view and adjusted to your rights and interests the need of hiring a lawyer, always keeping in mind that this does not imply an increase in the cost of the mediation process.