At our county court mediation is done by a separate person at the mediaors office. There is only the two parties and the mediator present. He then reports back to the court and the Judge decides if the mediation was a success in which case he makes an order granting what has been arranged between the parties but if not he arranges for a hearing where the parties attend in chambers with just the judge and possibly the mediator present. Other times, we have a mediator at court, a hearing is arranged and before you go in to see the Judge the mediator tries to sort things then you all go before the Judge and once again a decision is made. If its a complicated case the Judge may order further directions such as independant values etc.
If the Judge does make an order and you are not happy with it you have the right to appeal but then you may need the advice of a solicitor