A subtle point is expressed by مَا مِنْ أَجْلِهَا: the qualities in view help explain why the subsequent assertion is fitting. Following the attributes of the God-conscious with «أُولٰئِكَ عَلَىٰ هُدًى» signals that the description and the outcome belong together.
This does not establish a general claim that every good action automatically produces a guaranteed result. Here the discourse concerns guidance from the Lord and the specific Qur'anic promise of success. The rhetorical reasoning is that the listed attributes make the later judgment contextually appropriate.
Thus «أُولٰئِكَ» does more than point backward like a simple pronoun: it also foregrounds the relationship established by the preceding description.