Answer
More work is done on (b) spring 2.
Work Step by Step
Work done on the spring is given by $\frac{1}{2}kx^2$.
Thus, for the same distance compressed -
\begin{align*}
x^2=\frac{2\,W_1}{k_1}=\frac{2\,W_2}{k_2}
\end{align*}Since, $k_2>k_1$, $W_2>W_1$