As no external force is applied on the system,
vector Fext = 0
Wext = vector(Fext. x S) = 0
According to the work-energy principle, total work done = change in K.E. = Final K.E. - Initial K.E.
Negative sign implies that internal force of action and reaction act on the two blocks in a direction opposite to their motion.