I disagree with that assessment. At least with respect to Pakistan, ideological capture by the right-wing was facilitated by anti-democratic forces. There is a very strong "Mullah-military connection". It was during the dictatorship of General Zia in the 1980s that Pakistan officially became an "Islamic Republic". He banned public dance/music performances, established Shariah courts, introduced anti-women rape laws and instituted the blasphemy law which is mentioned in the linked article. More recently, the army has been facilitating the rise of Tehreek-i-Labbaik Pakistan through patronage, a right-wing reactionary party that primarily centers the defence of Islam and going after blasphemers. They also funded and armed several Islamist militant groups as proxies against India (not to mention the Afghan Taliban in the 80s with the help of the US).
Had Pakistan's democracy not been meddled with by the military, had we not gone through Zia's Islamization in the 80s, things would not be as fucked as they are today.
And from my vantage point as a Pakistani, the only reason things in India didn't get similarly bad until the recent rise of BJP is because India was founded as a secular democracy and had a functioning democratic system (at least relative to us). BJP is also a populist anti-democratic force, similar to MAGA in the US, Bolsonaro in Brazil, Duterte in the Philippines, and Georgia Meloni and her alt-right peers in Europe. Religious populism is not unique to us developing nations, it is a rising threat around the world. However, I will agree that we are suffering the worst of it because lack of civil rights and weak civil institutions.
I can't speak to how things are playing out in Libya, but in Pakistan western powers have almost done the opposite. They have no qualms in working directly with the military to further their geopolitical interests, and historically the periods of dictatorship have been when Pakistan has gotten the most economic & material assistance from the US.
Right now, Pakistan is undergoing yet another democratic crisis as the recent elections were clearly rigged by the military. The US has decided to treat it as an "internal matter" and not put any pressure. If they had done something like make getting the next IMF loan contingent on an external audit of the election results, or on stopping digital censorship (Twitter/X has been blocked here for the past 2 weeks to suppress discussion of the rigged election results), it might even the odds a bit and help citizens and political parties challenge the hegemony of the military over the political process.
But yes regime change and just toppling dictators and installing your favorite candidate is not the answer.