Bank A, because your account is with them and they'll be able to access all the information that they need to deal with the matter with Bank B.
However, if the ATM is at or inside Bank B's premises it's probably wise to rattle a couple of cages there too.