For a long time, people living in two densely populated Asian capitals have suffered the toxic smog that blanket their cities.

On some days, when the smoke draped Delhi and Beijing - both teeming cities with more than 20 million people - in an orange-grey hue, and the air tasted smoky, people said it felt like living in a dystopian nightmare. That time of the year is back in Delhi, but Beijing is breathing much better.

Particulate matter, known as PM2.5 - particles so small they can be ingested deep into the lungs - and a cocktail of gases hang heavy over land-locked Delhi, among the world's most polluted cities. Low wind speeds trap pollutants in the lower atmosphere, worsening air quality.

Authorities briefly close schools, order diesel vehicles off the roads, halt construction work, ask people to work from home, ban firecrackers. Much of this is difficult to enforce in India's chaotic democracy. Residents cough, wheeze and outrage, and life goes on.

On Monday, the morning after Diwali, the Hindu festival of lights, when revellers burst firecrackers despite the ban, Delhi was among the world's top cities for pollution. A government app showed the AQI (Air Quality Index) in some places climbing to above 520 recently.

On the same morning in Beijing, the skies were bluer, and the AQI levels were less than a fifth of Delhi's. Since 2013, Beijing - and China at large - has waged a determined war on air pollution using a range of command-and-control measures.

An ambitious action plan banned new coal capacities, shut off coal-fuelled heating in residential buildings, raised fuel and engine standards on diesel trucks and scrapped old, polluting cars, among other measures. People were encouraged to switch to electric cars and ride their bicycles for shorter trips.

Beijing worked hard to enhance air quality within the city, but the significant improvements over the last decade came when they extended their efforts beyond the city limits, according to Lauri Myllyvirta, an analyst at the Helsinki-based Centre for Research on Energy and Clean Air budget to fight air pollution leapt from just over $430m (£350m) in 2013 to more $2.6bn in 2017.

The results have been impressive. Air pollution in Beijing has declined by about 50%, and by about 40% countrywide since 2013, according to The Air Quality Life Index, or AQLI, produced by University of Chicago's Energy Pollution Institute. Chim Lee, China analyst at the Economist Intelligence Unit, said: "Beijing used to rank very high in the air pollution indexes.

“But it has seen a dramatic improvement. There's a strong push from coal to gas and renewable power sources. It is easier to buy electric cars than petrol ones".

Experts acknowledge that Delhi's two decade-long effort to improve air quality has also shown some results. The city has moved out formal polluting industries, shut coal-based power plants, introduced the world's largest natural gas-based public transport programme, forced old commercial vehicles off the roads, slapped stricter emission standards and built an efficient metro.

Have these measures impacted the city's air quality? Yes, they have, says Anumita Roychowdhury, an air pollution expert and the executive director of Delhi-based Centre for Science and Environment. "Long term air quality trends in Delhi show that levels are not going up on year-on-year basis,” she said.

“It is actually coming down. It means Delhi has stabilised the problem and bent the pollution curve. But it also means Delhi needs to slash PM2.5 levels by another 60% to be able to meet clear air standards".

Yet, Delhi's battle against air pollution stumbles due to inadequate planning, wrongly designed policies and partisan politics. Research shows that over half of Delhi's pollution stems from vehicular emissions. This is followed by smoke from coal-fired industries, burning of waste and dust from construction sites.

During winter, the burning of crop stubble in neighbouring Punjab and Haryana - a common practice during the harvesting season - can contribute up to a quarter of Delhi's air pollution on certain days, depending on wind speed and direction. Prime Minister Narendra Modi's Bharatiya Janata Party (BJP) government now blames the neighbouring state of Punjab, run by an opposition political party, for failing to tackle the problem.

By banning old vehicles, Delhi has reduced the number of cars on its roads - nearly eight million - by more than a third from the numbers recorded in 2015. Yet, vehicular emissions remain the primary contributor to pollution in a city whose urban design is friendlier towards cars and skewed against pedestrians and cyclists.

The nearly 400km (248 miles)-long Delhi Metro is the longest and busiest metro network in India but last-mile connectivity to homes and workplaces remains spotty. While around 14% of the city's 7,000 public buses are electric, ironically, bus ridership is declining due to inconveniences in usage.

Despite the Delhi master plan aiming for 80% of motorised trips to be taken by public transport, the lack of integration between the metro and bus systems has hindered the realisation of this target. "Even if you have a solution you are not able to make it work because you have not designed it rightly," says Ms Roychowdhury.

The lack of regional planning also hinders progress. While discussions revolve around pollution in Delhi, the neighbouring cities on the vast Indo-Gangetic plain - stretching across northern India, eastern Pakistan and parts of Nepal and Bangladesh - are also shrouded in smoke. Studies show that air pollution levels in Bihar are frequently higher than those in Delhi, yet there is limited discussion on the matter.

"The conversation cannot be just about Delhi. It has to be scaled up across the entire region," adds Ms Roychowdhury. This is where Beijing got it right, say experts.

It set a target to reduce air pollution by a quarter by 2017 and rolled out a regional plan that included neighbouring provinces. Between 2013 and 2017, fine particle levels in Beijing and the surrounding region fell by around 35% and 25% respectively.

"No other city or region on the planet has achieved such a feat," according to a United Nations review. Beijing moved away from coal and diesel much faster than Delhi. "Much of the decision-making Beijing did is tough in a democracy like India," Ms Roychowdhury says, adding that Delhi - and India - should be looking at how US and European cities controlled air pollution.

Also, despite progress, Beijing remains three times more polluted than Los Angeles - the most polluted US city - and falls short of being among the least polluted cities on Earth, according to AQLI.

Ms Roychowdhury says: "Delhi doesn't have time. We have to roll out everything in the next few years. Delhi - and India - needs to be prepared for disruptive action."