Initially, there will be induced charges of magnitude - q and +q on the inner and outer surface of the spherical layer respectively. Hence, the total electrical energy of the system is the sum of self energies of spherical shells, having radii a and b, and their mutual energies including the point charge q.
Finally, charge q is at infinity hence, Uf = 0
Now, work done by the agent = increment in the energy