Yes, the lesser of the two evils.
Actually, Ashraf Ghani was publicly fairly pro-Pakistan in his early Presidency--a welcome change after that mercurial idiot Karzai who would breathe fire against America and Pakistan one day and then kiss up to them the next day. Ghani's outreach to Pakistan had started to worry India initially. But Ghani was offering peanuts to Pakistan...
Abdullah Abdullah maybe more anti Pakistan but, unlike Ashraf Ghani, he does have significant support in the non-Pashtun groups inside Afghanistan.
Pakistan probably HAD to choose either AA or AG and decided to choose AG. I don't know why--perhaps working with Americans to ensure 'continuity' of the AG govt until the Big Daddy Taliban walks into the 'hood...
Having said that, a deal with AA, Hekmatyar, Dostum, and Taliban, brokered by big powers (and that doesn't include Iran, Turkey or India) and Pakistan is what Pakistan is probably looking to achieve.