Not all the dwarves are going to be lowbies. This is the greatest dwarven city in the world; it can be expected to have some high-level defenders, and those defenders have advantage on poison saves and resistance to poison damage. Throw in the golems (which are flat immune to anything a green dragon can throw at them) and a green dragon would have a tough time of it. A red would do better, though it would still struggle with the golems. A white could deal full damage to the dwarves and use its breath on the golems, but whites are the weakest of the chromatics and not terribly bright.I think the initial suggestion is the most iconic and the easiest: Fill a confined space with Frightful Presence and breath weapons. Repeat until the dwarves are dead or routed.
Obviously, greens would have the easiest time of this (it's what happened in my setting, helped along by the fact that said dwarves used a moat with a bridge they lowered into the muck as a primary deterrent to invading armies), but any but those with line-effect breath weapons can go to town this way.
Not all the dwarves are going to be lowbies. This is the greatest dwarven city in the world; it can be expected to have some high-level defenders, and those defenders have advantage on poison saves and resistance to poison damage. Throw in the golems (which are flat immune to anything a green dragon can throw at them) and a green dragon would have a tough time of it. A red would do better, though it would still struggle with the golems. A white could deal full damage to the dwarves and use its breath on the golems, but whites are the weakest of the chromatics and not terribly bright.
Some cunning on the dragon's part is definitely called for. As Trickster points out, a little spellcasting here would go a long way.
Why have the dwarves built a convenient cliff edge into their underground city, why are they sending their golems to fight next to it, and why does the room it's in have enough space for an ancient dragon to get airborne?An ancient dragon does not struggle with golems. It picks them up in its claws, flies them over the nearest edge (interior or exterior) and drops them. It does not even have its speed reduced and it can carry two of them (three if the DM allows a bite attack to be used for grapple).
What's the dragon's motivation? What's it after?
The reason I ask: as has been shown, an ancient red has many ways to single-handedly destroy this city. What would help pick the method, then, is knowing what the dragon wants. Does it want a particular treasure? Slaves? To make an example/fame? To cause suffering/humiliation?
That last one would make a good story. Maybe, long ago, a young red dragon made a lair. A troupe of dwarven explorers found that lair, killed the dragon, and sold the hatchlings to ambitious adventurers who wanted to explore the 1E "dragon subdual" rules. The explorers used the meager horde to establish a city. Now, hundreds of years later, the lone surviving hatchling is back. It doesn't just want to destroy the city. It wants to make the city suffer. Everyone loves a revenge story.
So, in this case, go with the starvation route. The dragon scorches the earth, kills entire caravans, re-routes or poisons water supply. It allows a few escape parties to flee until they get overconfident and send out a large exodus, and it wipes that out. It fakes a wing injury and lures a foot army out onto the field, and then bolts up, soars overhead, and enters the caverns. It fries everything it can find--particularly homes and food stores--before roaring out again, just before the returning army reaches the gate. With no food and no families, the remaining dwarves scatter or die in droves while trying to force a head-on confrontation. The dragon avoids or traps the golem defenders.
My point: don't just figure out the mechanical facts, figure out the motivation. Make it a story.