Just have it start flying overhead and dumping cartfulls of rock son them from 500ft high during the night.
Dragons should be fighting smartly. if they're spending days slogging through the brush 'following' them (they should easily be able to outdistance them on dragon wing and escape if they wanted to) then they have loads of time to prepare and fight dirty/smartly.
Have them steal a farmers cart and every night they start getting a cart of rocks falling on them from 500ft high. No long rests for them. And take that 10d6 bludgeoning damage for good measure.
They start being ambushed by bandits whove been promised a thousand gold each. Plus half of all treasure that party is carrying. And woah, they're loaded!
Have them cross over a bridge. And the bridge collapses under their weight, sabotaged.
They come across the dragons lair, its empty. A cart can carry a lot of gold too. But theres a few thousand at the back arranged around a large rock making it look like a big pile of treasure. And off to one side they can hear snoring. Whe they get inside and to that corner the dragons kobold servants ambush them and yell a lot about not getting to master while they're sleeping. The players by now, if they havent given up, must be pissed. They'll fight these kobolds. BBut its a trap. Kobolds, of course. First choking smoke bombs drop from the ceiling. Everyone in the cave starts having to make fort saves vs poison, can barely se. One big abscurement fight.
Then the cave entrance should collapse behind them sealing them in. Because Kobolds are master tunnelers, they know how to collapse a cave entrance. To be fair, have them roll perception to see the cave is all cracked.
The kobolds, whichever ones still survive, now flee in to tiny Kobold holes.
To be fair (again, dealing with a dragon I dont think too much fairness comes in to play when fighting a super genius 2000 year old creature) you can have them mine their way out if they have the right tools. or you can have them squeeze through the kobolds holes and start an underdark adventure to find their way out.