Magnetic reconnection occurs in turbulent plasmas like shock transition regions, while its exact role in energy dissipation therein is not yet clear. We perform a 2D particle-in-cell simulation for foreshock waves and study electron heating associated with reconnection. The probability distribution of Te exhibits a shift to higher values near reconnection X-lines compared to elsewhere. By examining the Te evolution using the superposed epoch analysis, we find that Te is higher in reconnection than in non-reconnecting current sheets, and Te increases over the ion cyclotron time scale. The heating rate of Te is 10%-40% miVA2, where VA is the average ion Alfvén speed in reconnection regions, which demonstrates the importance of reconnection in heating electrons. We further investigate the bulk electron energization mechanisms by decomposing under guiding center approximations. Around the reconnection onset, E|| dominates the total energization partly contributed by electron holes, and the perpendicular energization is dominant by the magnetization term associated with the gyro-motion in the inhomogeneous fields. The Fermi mechanism contributes negative energization at early time mainly due to the Hall effect, and later the outflow in the reconnection plane contributes more dominant positive values. After a couple of ion cyclotron periods from reconnection onset, the Fermi mechanism dominates the energization. A critical factor for initiating reconnection is to drive current sheets to the de-scale thickness. The reconnection structures can be complicated due to flows originated from the ion-scale waves, and interactions between multiple reconnection sites. These features may assist future analysis of observation data.