The argument here is due to Mahan Mj:

If $A, B$ are compact and not isometric, then the isometry group is the product.

Here is the point: Let $X=A \times B$ be the product manifold with the product metric. Let $f: X \to X$ be an isometry. Then each $f(A \times \{b\})$ is totally geodesic for every b.
so that $X$ fibers over $B$ with fibers $f(A).$ Further there is a section of the bundle map through every point. These sections are isometric to $B.$ So unless the factors are interchanged (when $A$ and $B$ are isometric), the isometry must be a bundle map. covering some isometry of the base (you can prove this from the existence of sections).
It follows that if $A, B$ are not isometric, the isometry group is just the product. else there is a quotient map of $Isom(X)$ onto $\mathbb{Z}/2\mathbb{Z}$ with kernel $Isom(A) \times Isom (A)$ (when $A, B$ are isometric).

The argument fails when $A, B$ are not compact. Notice that the isometry group of the plane is far larger than the isometry group of the line squared.