Using theoretical framework of the special relativity, we can show that the quantity that we classically regard as energy does have a property of inertia.
It's isn't as straightforward as having a scalar $m$ like in $\vec F=m\vec a.$ And if you have mechanical momentum like $\vec p=\vec vE/c^2$ then mass doesn't appear at all and $d\vec p/dt$ has to definitely adjust the energy and maybe the velocity or the speed too. But since the energy depends on the full 3d motion you don't get the simple separation of changes in velocity components for each of the three components like you do in Newtonian mechanics. But you can get a nice change in momentum.
No word games can change that momentum can steadily increase while energy and/or velocity can be a more complicated change.
And particularly, if the total energy of a box is $L$ then its inertia is $L/c^2$.
That's a pretty big claim. If it weren't so vague I'd say its provably wrong.
In $O$ frame, the total energy of capacitor is $L_1 = l_0 \int\frac{1}{2}\epsilon_0E^2 dA $ and thus its mass is $m_1 = L_1/c^2$.
That's not true. A capacitor has massive plates and charges and such and some stress holding all the charges together and so there is more energy than the fields, and there is stress so there is more than just energy.
In $O'$ frame, the total energy of the capacitor is $L_2 = l_0\sqrt{1-v^2/c^2} \int\frac{1}{2}\epsilon_0E^2 dA $ .
Now there is kinetic energy of the massive charges too, and the stress is involved as well.
Here also the mass is thus $m_2 = L_2/c^2$.
No. Mass isn't just energy divided by $c^2$ you need the total energy (not just some of it) and you need the momentum (and in this frame there is momentum for the charges).
But in general, in relativity we prove that $m = m_0/\sqrt{1-v^2/c^2}$.
That's not true either. Sure if the total energy momentum vector exists and is timelike then there is a center of momentum frame and in that frame there is an energy and if you divide that by $c^2$ you can call that the rest mass of the system. And then you can compare the total energy in other frames to that energy and it will be larger in the other frames.
But the spatial integral of the field energy is not the total energy and it isn't the time component of the total energy momentum of a system. And a good way you can tell physically is ...
There is no rest frame or center of momentum frame for a bare electric field with no charges.
So clearly the field energy isn't a tine component of a timelike vector. Which you can tell by the fact that there isn't a fixed frame where it is smaller than any other frame.
So why does this apparent contradiction is happening?
There is no contradiction. The energy of a bare electric field simply doesn't transform the way you claimed it does. No one said it did.
Were you expecting field energy to have a mass all by itself?
You did completely ignore whatever force is keeping those charged plates from slamming into each other (you ignored it in both frames), and that force has some energy too.
Does it have to do anything with the fact that actually both the $m_1$ and $m_2$ are infinities?
No. You could talk about finite sized capacitors. Or even do a calculation in a finite universe, such as a universe that is infinite in z the direction but if you go in the x or y directions it repeats Pac Man style.
The key is to avoid the bad physics. And just like two frames can disagree about which objects have kinetic energy, you must include absolutely every bit of energy, the stress of the plates and wires, the energy of the fields, the kinetic energy and rest energy of the parts of the plates, everything.