Judges are impartial arbiters - unless you can prove with sufficient and convincing evidence they have been bribed or are otherwise unable to impartially and dispassionately consider the pending case. It takes a lot of evidence to prove something like that.
Besides that, the defense attorney needs to argue facts and law and win. Just like in any other case. Motion practice can be done very well and very averagely depending not only on the attorney's experience and attention to detail but also on what the facts and law are. Having a motion denied is very commonplace for any attorney that has ever done any litigation - it is not the end of the day, all that matters is the ethos of "Win, baby, win" when you get a not guilty verdict or even a mistrial in certain circumstances.
Best of luck
There is NO attorney-client privilege based on this interaction. I am NOT your attorney. Further, everything we both just wrote is publicly available on the internet and would be the same as if we were talking in a crowded restaurant. If you need legal assistance use Avvo to find a local attorney in your jurisdiction that you feel can best represent your interests as a zealous advocate. My experience is in corporate tax, white collar criminal defense, partnership tax, and tax controversy/litigation. If you're being audited by the IRS or state taxing authority, or you are taking an unusually risky tax position on a return, that is the kind of thing you should have experienced counsel on your side and we can set up an initial consultation. If you have a family law, debt collection, violent crime sort of issue then I do not handle that. Do not contact me for an initial consultation on non-tax matters.