Twenty-three of those who got life terms were tried in absentia, including Ali, according to an Egyptian criminal court handling terrorism-related cases.
The court also sentenced 44 others including children to terms ranging from five to 15 years in prison over the same charges. Twenty-one were acquitted, according to defense lawyer Ossama Badawi.
Those sentenced were convicted of a set of charges that included inciting violence against security forces and state institutions. The case stemmed from the 2019 protests in the port city of Suez that sits at the mouth of the Suez Canal.
Authorities arrested hundreds of people at the time in Cairo and across the country. Many were released but others were referred to trials.
Rights groups have repeatedly criticized such mass sentencings in Egypt and called on authorities to ensure fair trials.
Egypt’s government has in recent years jailed thousands of people, mainly Islamists, but also secular activists involved in the 2011 Arab Spring uprising that toppled longtime ruler Hosni Mubarak.