We investigate stochastic acceleration of electrons moving through a chaotic electrostatic field (CEF). Acceleration mechanism is based on irregular scattering of electrons experiencing random pulses in the CEF. Despite the fact that the pulses have random values and orientations, a specific stochastic acceleration of electrons occurs. This acceleration mechanism is analogous to the well-known second-order Fermi acceleration. It can act in various media, where random inhomogeneities create a chaotically distributed electric field. In this paper the phenomenon is investigated specifically for thunderclouds, where the CEF is formed by randomly distributed charged hydrometeors and ions. We show that acceleration process is threshold: the electron flux is accelerated, if the mean CEF value exceeds a certain threshold value, and decelerated otherwise. Accelerated electrons can form the avalanche of relativistic electrons, producing intense bremstrahlung gamma ray radiation. Proposed stochastic acceleration of electrons in the CEF complements second-order Fermi acceleration, expanding its application to static chaotic fields.