On categorical conditions for congruences to commute