Published: 2019-03-30 04:10:10 BdST
Chasing 278 to win, Pakistan were in cruise control with Abid and Rizwan adding 144 runs to take the total to 218-3 before the middle order imploded in familiar fashion.
Ali, whose 112 off 119 balls was Pakistan's record ODI score on debut at the age of 31, holed out to leg-spinner Adam Zampa.
Umar Akmal and debutant Saad Ali fell for seven each to paceman Nathan Coulter-Nile, who finished with 3-53, while Marcus Stoinis removed Rizwan (104) and Usman Shinwari (six) in the final over to seal Australia's seventh consecutive ODI win.
It was only the fourth time in history that a side has lost an ODI chase with two centurions.
"I thought our composure with the ball was really good," said Australia captain Aaron Finch.
"We knew how slow the wicket was, we knew if we could get some new batters in it would be tough. Credit to our boys, though Abid and Rizwan getting hundreds were great knocks."
Earlier, Glenn Maxwell fell short of a fighting hundred by two runs but guided Australia to a competitive 277-7 on a slow track, repairing the innings alongside wicketkeeper-batsman Alex Carey (55).
The 30-year-old Maxwell was closing in on his first ODI century in four years but was run out while selflessly chasing a second run in the final over of the innings.
Sent out to bat first, Australia began steadily as in-form openers Finch and Usman Khawaja stitched together a 56-run partnership in 12 overs.
Finch was first to depart when he was trapped leg-before by fast bowler Mohammad Hasnain before Shaun Marsh and Peter Handscomb fell to Imad Wasim's left-arm spin.
Leg-spinner Yasir Shah removed Stoinis and Khawaja, who finished with 62.
That left Maxwell and Carey with a rebuilding job and they combined for a sixth-wicket stand of 134 runs, stepping up the scoring rate in the final 10 overs.
Australia lead the five-match series 4-0 with the final match scheduled in Dubai on Sunday.