I have been trying to prove this for a while but failed so far.

Let $A$ and $B$ are two positive, self-adjoint operators with compact resolvent on a Hilbert space $H$ defined on the same dense domain $D \subset H$ and suppose that $A^{-1}B$ extends from $D$ to a bounded operator on all of $H$. Suppose that both operators have trivial kernel. If $A^{-1}B - \mathrm{id}$ is trace-class, is then $$\det(A^{-1}B) = \prod_{j=1}^\infty \frac{\mu_j}{\lambda_j},$$ where $\lambda_1 \leq \lambda_2 \leq \dots$ are the eigenvalues of $A$ and $\mu_1 \leq \mu_2 \leq \mu_3 \leq \dots$ are the eigenvalues of $B$? In particular, do the assumptions imply that the product converges absolutely?