Why do mountain passes have serpentine roads?

Any work can be done in many ways. What matters is how it is done. We can climb the mountain in two ways. If we take the shortest route, we need to apply a lot of force. If we gradually ascend towards the top using the serpentine roads, it takes long, but saves energy. It is based on the law of physics: Work = Force x Distance.