A commonly used assumption for modeling electrons in the collisionless plasma expansion into a wake is that the electrons are an ideal gas following a thermodynamic process governed by the polytropic law. The validity and accuracy of this assumption are assessed through a direct comparison between hybrid particle-in-cell (PIC) and fully kinetic PIC simulations. The electron thermal energy transfer along with the expansion process is analyzed. It is shown that a collisionless plasma wake can be divided into a fluid-like expansion region and a kinetic expansion region based on the local equilibrium degree of the electrons. In the fluid-like expansion region, the electrons are near equilibrium and almost isothermal, and the accuracy of hybrid PIC in that region can be improved by properly tuning the polytropic coefficient. In the kinetic expansion region, the electrons are strongly nonequilibrium, and the accuracy of hybrid PIC is always poor. Consequently, a fluid model with a polytropic thermodynamic law for electrons is meaningless in that region.