In reply to buzby:
The answer depends upon what you mean by "distance travelled."
For most purposes, when people talk about "distance travelled" on the ground they mean the horizontal component, ie how far it would be if the surface was completely flat. Then folks add a different measure which is the height gained and lost. So you have two numbers.
You appear to be asking a different question: if you were to lay a string over the route you travelled, then how long would that string be?
This is a complex question.
If you take your example of 10 miles horizontal distance incorporating two 4,000 feet hills, then there are two factors that will make the bit of string longer or shorter.
First, what is the total height gained and lost? The bigger this answer, the longer the string. This is obvious when you think about it: if you start roughly 2,000 feet (eg the Cairngorm car park) then your string will cover more ground than if you start at 200 feet (eg Glen Nevis). Likewise if the drop between mountains is only 500 feet your string will cover less ground than if the drop between hills is over 1,000 feet.
To add to the complexity, gaining 4,000 feet in a steady incline over 2 miles means the length of the string following your route will be shorter than that following a path that is level for one mile and then gains 4,000 feet in the second mile.
Finally you have the fractal problem of the earth's surface.
What if the route goes over peat hags and you are constantly going up and down slightly? Do you measure the distance covered differetly from walking along tussocky grass, differently from walking over smooth grass? If you walk for a half a mile horizontal distance over a horizontal boulder field, does your distance walked increase as the boulders get bigger?