However, this formula is for an internally reversible process (where no irreversibilities occur within boundaries), but for each system A and B, there is indeed irreversibilities (heat transfer) so I am not sure how this equation applies at all.
It is correct that the heat transfer process in your example is irreversible. But to calculate the entropy change you can devise any convenient reversible process that connects the initial and final states and apply the equation. You can do this because entropy of each solid is a state function that does not depend on the process connecting the equilibrium states. So your equation is correct. For an excellent primer on calculating entropy change check out @Chet Miller entropy recipe here: https://www.physicsforums.com/insights/grandpa-chets-entropy-recipe/
To apply the equation, imagine you separately place each solid in contact with an infinite series of thermal reservoirs that begin at the initial temperature of the solid and end at the final temperature of each of the solids, $T_F$. The temperature of each reservoir in the series differing infinitesimally from the solid and from the previous thermal reservoir. This assures the heat transfer for each solid is reversible, i.e., each solid is always in thermal equilibrium.
Since the initial temperatures of the two solids $T_A$ and $T_B$ are different, the actual heat transfer process is irreversible and the principle of entropy increase should apply, that is
$$\Delta S_{tot}=\Delta S_{A}+\Delta S_{B}>0$$
Example:
For simplicity, consider the case where the two solids are identical except for their initial temperature. Then the final temperature is the mean of the initial temperatures. Let $T_A$ = 600 K and $T_B$ = 300 K. The final temperature is then 450 K. Then from the equation we get
$\Delta S_{A}$ = mc ln$\frac{450 K}{600 K}$ = - 0.2876 mc
$\Delta S_{B}$ = mc ln$\frac{450 K}{300 K}$ = + 0.4055 mc
$\Delta S_{tot}$ = + 0.1179 mc
Which equals the entropy generated by the irreversible heat transfer. We should expect that the smaller the temperature difference, the less entropy generated. For example, let $T_A$ = 400 K and $T_B$ = 300 K. The final temperature is then 350 K and we obtain.
$\Delta S_{A}$ = mc ln$\frac{350 K}{400 K}$ = - 0.1335 mc
$\Delta S_{B}$ = mc ln$\frac{350 K}{300 K}$ = + 0.1542 mc
$\Delta S_{tot}$ = + 0.0206 mc
In the limit, where $T_{A}=T_B$, the process is reversible and $\Delta S_{tot}$ = 0.
Hope this helps.