As the velocity of the molecule remains same after it hits the horizontal wall; therefore, the energy of the molecule remains conserved. Hence, it is an example of an elastic collision.
The momentum of the gas molecule will remain conserved irrespective of whether it is an elastic or an inelastic collision.