The net work done by the tension in the figure when the bigger block of mass M touches the ground is
Work done by tension on M is negative (force and displacement are in opposite directions). But work done by
tension on m is positive. Net work done will be zero.