Why don't they cancel out?
Forces in an action-reaction pair act on different bodies.
FAB acts only on Cart A.
FBA acts only on Cart B.
Because they act on different objects, they do not sum to zero on a single Free Body Diagram. However, their resulting accelerations (a = F/m) will be entirely different if their masses differ.