A pronoun can refer back to the same group and establish grammatical continuity. A demonstrative, however, may add renewed singling-out and attention: the addressee is directed specifically to the people characterized by the previous clauses.
Contrast:
«هُمْ عَلَىٰ هُدًى» — “They are upon guidance,” a straightforward reference.
«أُولٰئِكَ عَلَىٰ هُدًى» — “Those people, marked by the stated qualities, are upon guidance,” a pointed conclusion.
This is a rhetorical comparison, not a universal rule that demonstratives are always superior to pronouns. The benefit depends on audience knowledge and communicative purpose.