An electron that is far away from the nucleus have higher energy than an electron near the nucleus. Nucleus are positively charged and those electrons near it get attracted; those electrons gain kinetic energy hence reducing their internal energy. The electrons far from nucleus have low kinetic energy hence more internal energy.
Here, as the charge is uniformly distributed in the sphere, we will consider s as an area of the sphere which is, s=4πr2 and r is radius of the gaussian surface shown in the figure above. From this, it can be seen that