hasanbalkan, my first response is that gravity is a conservative force, meaning we can define a gravitational potential energy U such that the gravitational force (force is the opposite of the gradient), and the work done in moving an object or system from one position to another is equal to the change in potential energy of the object or system, and is independent of path (the fundamental theorem of line integrals). Thus as the two paths start with states of the same potential energy (for a massless tank), and end at the same state, the change in potential energy, and thus work, is the same for both paths.
More explicitly, you can use the fact that , where is the unit vector in the positive z direction, which we make the upward direction. To lift the liquid, the force we apply (from which we compute the work) is the opposite of this. Thus, when a bit of liquid of volume dV, and thus mass is raised (from the ground z=0) by a height h, the work done is
Thus the work to fill the tank at height H is
where S' is a sphere of radius R with center at a height z=R+H, in other words, the region of the tank's interior at that height.
Similarly, the work to fill the tank on the ground is
where S' is a sphere of radius R with center at a height z=R, in other words, the region of the tank's interior when on the ground.
And the work to lift the tank from ground to a height H is simply , where is the total mass of liquid in the tank.
You can thus perform the integrals (converting to cylindrical coordinates will help) and show