Some Judges do get paid more than Lawyers especially if the Judge is a Federal Judge and not just a Local Judge.
However in some places lawyers can earn more money annually than a Judge.
In some places a Lawyer can earn $375,000.00 per year while a local Judge may only earn $212,000.00 per year.
Judges usually go through much more schooling than a lawyer so a Judge really should earn more money per year than a Lawyer does.
However the Lawyer can get more cases to work with and the more cases they work on the more money they can make.
Lawyers typically do more work though than a Judge even though a Judges job isn't just about hearing a case or sentencing the person in court to jail or prison etc.
The Judge has to go back to their chambers and review cases and determine whether to proceed with the case or not and how to proceed.
There's a lot of work going on behind the scenes that a Judge is working on that the public doesn't get to see.