You don't need to have a displacement in order to do work on a charge q
in an electric field E. If you use
W = \int{F.dr}
as the definition of work W, then in this case, the force F is
F = qE
The electric field can be written E = -d(phi)/dr, where phi is the
electric potential. So
W = \int{F.dr} = \int{qE.dr} = \int{q(-d(phi)/dr)dr} (1)
where "\int" means integral. But
d(phi) = (d(phi)/dr)dr (2)
so if you insert (2) into the last equation in (1), you get
W = \int{q(-d(phi)} (3)
Equation (3) is more fundamental than the last equation in (1) for the
work done on a charged particle in an electric field. Here, you can
see that the work done on the charge q does _not_ depend on it's
displacement, but only on the change in potential at its location. Work
is done on a charge to keep it in place, even if it has not moved, if
the potential at its location has changed.