We have King Theoden, Eomer, Aragorn, Legolas, Gimli, and Merry pausing at the Hornburg. From here, the party split into two: Party 1 - Theoden, Eomer, and Merry; Party 2 - Aragorn, Legolas, and Gimli. Both Parties decide to go to Dunharrow. However, Party 1 decides to take the mountain roads, which takes two days longer. Why is this?
There was a need for secrecy, where Aragorn had a need for haste.
It's tucked away in various passages of the chapter, but Aragorn makes several references to Theoden's fear of the winged beast that flew over Meduseld, and his requirement for secrecy to remain hidden from the enemy.
The king is now determined to set out at once. Since the coming of the winged shadow, he desires to return to the hills under cover of night.
Return of the King - Book V, Chapter 2: The Passing of the Grey Company
Then, by your leave, lord, I must take new counsel for myself and my kindred. We must ride our own road, and no longer in secret. For me the time of stealth has passed. I will ride east by the swiftest way...
Theoden continued through the mountain paths for although Gondor needed aid, he needed secrecy. Aragorn however had a lot more ground to cover. He had to pass through the Paths of the Dead, summon the dead, ride across the southern plains of Gondor and then return by boat from Umbar to Minas Tirith. His need for haste was far greater than Theoden and Theoden therefore chose secrecy.