That may be true, but the fact is that cycling is a more energy-efficient form of transport than walking. It takes literally less effort to go the same distance.
When your bike is rolling also on flat ground, you have literally zero effort to move your position. With walking it is effort, your muscles must work for every meter you make.