Trump has filed an Article 78 proceeding in the New York's state courts according to the New York Times which broke the story. While this is a proceeding in the style of a lawsuit against the judge, it is functionally a form of appeal or common law writ, which does not seek money damages.
It is meritless. But it isn't within the scope of Stump v. Sparkman which restates the rule that judges are absolutely immune from civil lawsuits for money damages against them.
Article 78 of the Civil Practice Law and Rules starts with Section 7801 which explains that this is a statutory substitute for common law writ practice:
§ 7801. Nature of proceeding. Relief previously obtained by writs of
certiorari to review, mandamus or prohibition shall be obtained in a
proceeding under this article. Wherever in any statute reference is
made to a writ or order of certiorari, mandamus or prohibition, such
reference shall, so far as applicable, be deemed to refer to the
proceeding authorized by this article. Except where otherwise provided
by law, a proceeding under this article shall not be used to challenge
a determination:
which is not final or can be adequately reviewed by appeal to a court or to some other body or officer or where the body or officer
making the determination is expressly authorized by statute to rehear
the matter upon the petitioner's application unless the determination
to be reviewed was made upon a rehearing, or a rehearing has been
denied, or the time within which the petitioner can procure a
rehearing has elapsed; or
which was made in a civil action or criminal matter unless it is an order summarily punishing a contempt committed in the presence of the
court.
One of the multiple reasons that the lawsuit is meritless is that Article 78 proceedings don't apply to determinations made in criminal cases, except in cases where someone is summarily held in a punitive direct contempt of court finding for their in the courtroom misconduct (which Trump has not been, yet). It is usually used to appeal decisions in quasi-judicial administrative law and local government proceedings.
It is nothing more than a frivolous delay tactic, which may or may not work at even securing any delay of a criminal case, and a publicity stunt. Indeed, the lawyers filing this Article 78 proceeding face a serious risk of having their licenses suspended or being disbarred for their intentionally frivolous litigation conduct.
Claims Against Prosecutors
Prosecuting attorneys have absolute immunity from civil liability for money damages for their acts in connection with the criminal prosecution process in court (e.g. charging decisions and post-criminal complaint/indictment conduct). But prosecutors have only qualified immunity to the extent that they are participating directly in the investigative phase of a criminal prosecution (e.g., the issuance of search warrants and the conduct of interrogations).
Without knowing the nature of a hypothetical lawsuit, it is difficult to evaluate this issue.