In general, the knowledge of the marginals $\rho_A$ and $\rho_B$ and the operators $A$ and $B$ is insufficient to compute $\mathrm{tr}_A((A\otimes B)\rho_{AB})$. Indeed, we can find two different density matrices $\rho_{AB}$ and $\sigma_{AB}$ with the same marginals for which
$$\mathrm{tr}_A((A\otimes B)\rho_{AB}) \ne \mathrm{tr}_A((A\otimes B)\sigma_{AB}).$$
One such counterexample uses the elements of the Bell basis $|\beta_{ij}\rangle = X_A^iZ_A^j|\beta_{00}\rangle$ with $|\beta_{00}\rangle=(|00\rangle+|11\rangle)/\sqrt{2}$ and $i,j=0, 1$. In this case
$$
\begin{align}
\mathrm{tr}_A((A_A\otimes B_B)|\beta_{ij}\rangle\langle\beta_{ij}|) &= \mathrm{tr}_A\left[(A_A\otimes B_B)X_A^iZ_A^j|\beta_{00}\rangle\langle\beta_{00}|Z_A^jX_A^i\right] \\
&= \mathrm{tr}_A\left[(A_A\otimes B_B)Z_B^jX_B^i|\beta_{00}\rangle\langle\beta_{00}|X_B^iZ_B^j\right] \\
&= \mathrm{tr}_A\left[(I_A\otimes B_B)Z_B^jX_B^iA_B^T|\beta_{00}\rangle\langle\beta_{00}|X_B^iZ_B^j\right] \\
&= BZ^jX^iA^T\,\mathrm{tr}_A\left[|\beta_{00}\rangle\langle\beta_{00}\right]\,X^iZ^j \\
&= \frac12BZ^jX^iA^TX^iZ^j
\end{align}\tag1
$$
where we exploited a useful and easy to check property that $(A\otimes I)|\beta_{00}\rangle = (I\otimes A^T)|\beta_{00}\rangle$. We see that if $A$ and $B$ are non-singular, then for the expression $(1)$ to yield the same value for all $i,j$ we need $A$ to commute with $X$ and $Z$. However, any operator $A$ on $\mathbb{C}^2$ can be written as $A=aI+bX+cZ+dXZ$ and it is easy to see that if $A$ commutes with $X$ and $Z$ then $b=c=d=0$. Consequently, $A=aI$.
We conclude that if $A\ne aI$ then $\mathrm{tr}_A((A\otimes B)\rho_{AB})$ is not uniquely defined on the set of density matrices $\rho_{AB}$ with given marginals $\rho_A$ and $\rho_B$. Therefore, no general formula for $\mathrm{tr}_A((A\otimes B)\rho_{AB})$ in terms of $A$, $B$ and the marginals exists.