There is, of course, a difference. Depends on the ratio of leg length and step height. To answer, it is necessary to draw up a model of the muscles of both legs and integrate their work for 4 steps. The mgh formula is completely inappropriate here. Rather, the sum of integrals F_i (r, θ, φ) dr dθ dφ for each ith muscle in the model (more than 20).