Resonance with different size orbitals
The fundamental question is: which is more acidic, 2-pyrrolidone or 2-pyrrolidinethione?





If you took a 50-50 mixture of the two and added enough alkali to neutralize half of the mix, what would be the composition of the solution? The mismatch in p orbitals between C and S leads to more C=N bonding, rather than C=S, with a charge separation, leading to more negative charge on sulfur in Y and more positive charge on N, so this N will be more acidic than the N in W. The charge separation by oxygen, leading to more double bond character between positions 1 and 2 in 2-pyrrolidone is an effect also, but apparently not as large as the p-p mismatch between C and S.

The Lewis diagrams don't show clearly enough the actual charge distribution in the anions.

And I thank Jan for pointing out that I completely flipped my actual explanation when I thought I understood what two effects were happening. Although this is not a trick question, I think it needs more context to be able to be of predictive value. Maybe just a way to get you thinking: what could be going on here, and where else might it explain.