My recollection is that parties who wish to file amici briefs must first petition the court for permission to do so. The petition probably includes some description of how the filing party is affected by the pending decision. I've certainly never heard of such a filing in a criminal case.
I think what the judge is missing is that the amici can have no effect on his ruling. Neither the judge nor any amici are parties to this controversy. If the judge has the power to dismiss, then I think he must do so. I don't think the judge would be justified in ordering a prosecutor to knowingly prosecute a defendant whom the prosecutor believes is innocent.
In this case the prosecutor is claiming that no crime was committed. The fact that some amici claims otherwise is simply not relevant. Prosecutors decline to prosecute cases virtually every day. I doubt that judges concern themselves with that.
I always thought that amicus curiae briefs were useless. Just window dressing. (Not a lawyer.)