Find the expression for the work done in turning the cylinder through one revolution

What you found in the previous exercise is that the sum of the longitudinal forces exerted by the cylinder on the cable, or (by equal and opposite interaction) the sum of the tangential forces exerted by the cable on the cylinder, is equal to the difference between the forces exerted by the weights on each end of the cable.

From the previous exercise, I infer that $W$ and $w$ are the actual weights of the objects attached to each end of the cable, not the masses of those objects.

So as you turn the cylinder, the surface of the cylinder moves a certain distance $d$ (one circumference) against the resistance $W - w$, doing $(W - w)d$ work.

This of course is exactly the conclusion you would get by observing how much work is done to raise the weight $W$ a distance $d$ while lowering weight $w$ the same amount.

In the case where the weight does not rise, the cable must slip along the surface of the cylinder. Then we need to know a fact about the friction between the cable and cylinder that does not seem to be explicitly given in the problem: How does the coefficient of friction change when the cable is slipping?

When you raise $W$ from the ground by slowly rotating the cylinder, the cable must not slide along the surface of the cylinder and the relevant coefficient of friction is the static coefficient of friction. But when the weight does not move, the cable must slide along the surface of the cylinder and the relevant coefficient is the kinetic coefficient of friction. In real lift the kinetic coefficient of friction is often different from the static coefficient and a calculation based on the static coefficient does not apply to a sliding cable.

If we assume the kinetic coefficient equals the static coefficient, then the forces on each little bit of cable are the same in both scenarios (weight slowly lifted or weight not lifted) since the radial forces computed in the other exercise apply exactly the same way in both cases. So the cylinder does exactly the same work rotating through the same angle in each case. This just happens not be be a realistic answer.