Dhul Qarnayn and Taloot are both Wali of Allah...
Dhul Qarnayn and Taloot are both Wali of Allah, however, they are not prophets, messengers nor Awsiyaa. The term Imam refers to the leader, director, and governor whom the people follow and take as their example. So it is fair to conclude that all of the prophets, messengers, Awsiyaa, and Awliyaa are Imams. However, not every Imam is a prophet, messenger, Wasi, or Wali. The message of Allah (SWT) conveyed by a prophet or messenger is very important, valuable, and precious.
Logically, it is the most important component in the life of a human being since it guides him to his Creator, the reason behind his creation, and what are His expectations from him. Based on this great importance, we can logically deduce that such great matter will not only end simply by the birth of the religion at the hands of the Prophet and its conveyance to the people. Rather, there must be continuous supervision and ongoing care to this newborn religion.
That is necessary and essential until it becomes strong and stands firmly on its feet. This requirement leads us to further deduce that there must exist someone who will take on the role of caretaking during the absence of the prophet, whether during the lifetime or after his death. Therefore, it is logical to expect the presence of Awsiyaa for every messenger, even if it still did not happen.
For instance, consider this example: A king rules over a great kingdom for a long period of time and he does not have any inheritor or successor to manage his reign after him. The king then decides to get married and his wife becomes pregnant. So the king and the entire kingdom are anticipating the arrival of this important child who will become the successor and future king when he grows up. Now, what can the mind expect that the king will do when his child is born?
Will the matter simply end with the birth of the child, or can you expect that the king will arrange for the best of caretakers and teachers to raise the prince child as well as protect, care, raise, and teach him? This would be the case until he grows up and is able to handle the responsibility of the kingdom alone when he becomes the new king after his father dies. This is surely expected to happen and if anyone denied this idea, they would be contradicting logic and sound judgment.
In some cases, the king may even form an advising council to look after the prince in all aspects of his life.