To some extent, yeah. Powering up a hill with a heavy pack benefits from leg strength, just like powering up a hill on a bike. Cycling and climbing are decent complements, too, but climbing benefits a lot more from calf and upper body strength, neither of which cycling does a lot for. But all exercise is good.