A man A reaches the first floor by staircase whereas the man B uses escalator to reach the first floor from the ground floor. Both have same mass. The work done by both the people is equal I.e. Mgh . But work is a path function it depends on the path being followed . Then why is the work done in above two cases equal mgh? How?