Stochastic heating and acceleration of electrons by high-intensity lasers in inhomogeneous plasmas