First charge grows little amount of voltage across the capacitor plates, and then second positive charge will come to the positive plate of the capacitor, but gets repealed by the first charge. As the battery voltage is more than the capacitor voltage then this second charge will be stored in the positive plate. At that condition a little amount of work is to be done to store second charge in the capacitor. Again for the third charge, same phenomenon will appear. Gradually charges will come to be stored in the capacitor against pre-stored charges and their little amount of work done grows up.
It can’t be said that the capacitor voltage is fixed. It is because of the capacitor voltage is not fixed from the very beginning. It will be at its maximum limit when potency of capacitor will be equal to that of the battery.
As storage of charges increases, the voltage of the capacitor increases and also energy of the capacitor increases.
So at that point of discussion the energy equation for the capacitor can’t be written as energy (E) = V.q
As the voltage increases the electric field (E) inside the capacitor dielectric increases gradually but in opposite direction i.e. from positive plate to negative plate. Here dx is the distance between two plates of the capacitor. Charge will flow from battery to the capacitor plate until the capacitor gains as same potency as the battery.
So, we have to calculate the energy of the capacitor from the very begging to the last moment of charge getting full.