Tell B that even you may indirectly owe B through A, you can not pay B unless judge says so with court document that you will owe A less.
So see B in court and explain this to judget. You shall have no problem to win the case.
My advice to beginner landlords, if you are not handy, you shall start slow. Better yet, learn the handyman work little by little.