(a) it shall be the duty of the trustee, if he is a party, to defend the trust against such application, and if he knows of the action or proceeding but is not a party, to make application for intervention therein for the purpose of defending the trust;
(b) any beneficiary of the trust having a trust claim may intervene in the action or proceeding to defend the trust against such application.