The tournament's top scorer found the net in each half as Qatar made it three wins from three in this year's tournament, setting up a last-16 tie with Iraq.
Ali's first came in first-half stoppage time, not long after team-mate Hasan Al Haydos' penalty had been saved, and Qatar's in-form striker headed home 10 minutes from time to make sure they finished top in the group stage for the first time in their history.
Saudi Arabia, who came into this game having also won two out of two, will now face Japan in the first round of the knockout stages.
Fahad Al Muwallad came close to giving Saudi Arabia the lead when he hit the post before Ali won a spot-kick when Ali Hadi Albulayhi brought him down with an ill-judged slide tackle.
Al Haydos' spot-kick was denied when Mohammed Al Owais' left leg blocked an attempt that was heading straight down the middle, though Qatar did not have to wait too long for their opening goal.
Confusion at the heart of Saudi Arabia's defence saw two players leave a clearance to each other, with Ali capitalising to coolly slot home to put Qatar ahead just before the break.
Qatar were denied a second from a corner when Ali was adjudged to have impeded Al Owais at the near post early in the second half.
However, Saudi Arabia did not heed the set-piece warning, leaving Ali unmarked to nod in a second.