Generation of energetic electrons by an electron cyclotron wave through stochastic heating in a spherical tokamak