If the former, then can't the objection be brought up that those prophets were essentially predestined heaven (and therefore making Allah unjust in some way)? If the latter, then is it possible for ordinary people to reach the level of prophets? If this is not possible and if what makes prophets better than ordinary humans the fact that Allah has granted them wahy and knowledge, then is it fair ask why ordinary people don't also receive that same treatment as mentioned by 12:24 which would thereby guarantee them heaven and protection from sin? If the granting of wahy and knowledge is conditional upon someone having intelligence and purity, then is it a reasonable objection to say that intelligence is not a controllable factor? If intelligence is not a controllable thing, then can the same objection be brought up that most intelligent people who are granted prophethood are guaranteed heaven (thus making Allah unjust again) because their uncontrollable faculty of reasoning was why they were granted wahy which prevents them from sin? (That is, someone's uncontrollable circumstances has led them to have a higher capacity, and therefore they have a greater opportunity to reach a higher level of heaven than ordinary people).
Prophets were selected by Allah The Glorious, according to His Absolute Knowledge about every thing including the future of every creature. He knows who will be among all humans the most humble and who will not commit sins and who will be suitable to guide people. All Prophets were ordinary persons but Allah selected them because of the top piousness from all people to guide people. (Aal Imran: 33).