It has been stated in our religious teachings that all prophets and messengers have no advantage and virtue over the imams, other than the fact that they bear prophethood, while the imams are the bearers of whatever knowledge all of the prophets before them ever possessed. Also, according to hadiths, “The Great Name” of Allah (swt) consists of seventy three “letters” in which the prophets only knew a few of; even Prophet Ibrahim (pbuh) only knew eight of those “letters”, while Prophet Muhammad (pbuh) was aware of all but one of them and passed on this knowledge to the imams (as) after him.
The prophets, imams, and divine apostles all have specific ranks and statuses in our teachings, and the superiority of the imams over all other prophets except Prophet Muhammad (pbuh) is something that can be proven. Here, we will point to some of the reasons for this claim:
1- The rank of imamate is higher than that of prophethood; regarding Prophet Ibrahim (pbuh), the Quran says: “وَ إِذِ ابْتَلى إِبْراهیمَ رَبُّهُ بِکَلِماتٍ فَأَتَمَّهُنَّ قالَ إِنِّی جاعِلُکَ لِلنَّاسِ إِماماً قالَ وَ مِنْ ذُرِّیَّتی قالَ لا یَنالُ عَهْدِی الظَّالِمینَ”. 
Allamah Tabatabai interprets this verse like this: “Towards the end of his life, after passing many hard exams, Prophet Ibrahim (pbuh) reached the level of imamate, although he had it before, but at the same time didn’t bear the capacity necessary for it.” 
2- The imam (as) is one who guides with a divine entity he bears. In essence, imamate is an authority and impact that the imam has regarding the actions of the people. His guidance isn't like that of the prophets; the prophets only advise and preach, while the imam’s guidance is to actually take the hand of his followers and help them reach the straight path. 
3- Prophet Isa (pbuh), which was one of the five highest prophets (Ulul-Azm) bearing prophethood, will return during the time of Imam Mahdi (aj) and will follow him in prayer. 
In order to explain how such a matter is possible, one must say that according to the rules of the Quran and tradition, and philosophical and gnostic rules, which are actually an explanation and interpretation of the secrets that lie in the Quran and tradition, it is possible for a person who bears the truths and secrets of the names of Allah (swt), but doesn’t bear prophethood, which is only a legislative rank (a rank in which allows one to legislate religious law), to be ahead of a prophet and be his guide; like the person who bears the rank of being judge, his decision has credibility and it is he who gives the final verdict, nevertheless, this rank is temporary and can always be taken away. On the other hand, there might be someone next to him that isn't a formal judge, but is more learned and has more virtues than him. Therefore, although Prophet Isa (pbuh) is a prophet and bears a legislative or tashri’i rank, thus being higher than the imam from this perspective, but the imam has generative or takwini authority which the prophet (pbuh) doesn’t, making him higher than him, although he is one of the great Ulul-Azm prophets.  The fact that Prophet Musa (pbuh) followed Khidhr (pbuh) is good proof of this matter. The Quran has pointed to this event in some of its verses. These verses disclose that Prophet Musa (pbuh), who had his own religion and also bore the ranks of prophethood and imamate and was known as Kalimullah (the one who spoke with Allah (swt)), went to a servant of Allah’s (swt) who had been taught divine knowledge, but had no religion and no book, and asked him if he (Prophet Musa (pbuh)) could accompany and learn from him. Khidhr tells him that he (Prophet Musa) doesn’t have the tolerance needed to accompany him, and later scolds him harshly saying: “Didn’t I tell you that you can't accompany me?!”, and scolds him afterwards even harsher saying: “You can't stay with me anymore!”. 
4- “The Great Name” of Allah (swt) consists of seventy three “letters” in which Asef ibn Barqiya knew of one, Prophet Isa (pbuh) knew of two, Prophet Musa (pbuh) knew of four, Prophet Ibrahim (pbuh) knew of eight, Prophet Nuh (pbuh) knew of fifteen, Prophet Adam (pbuh) knew of twenty five and Prophet Muhammad (pbuh) knew of seventy two of them in which he passed on to the imams after him. 
5- All of the things that the prophets had, such as the Prophet Musa’s (pbuh) staff, were in the possession of the imams and are now in the possession of Imam Mahdi (as). 
6- The imams (as) share all of that which the prophet of Islam (pbuh) had, except for being prophet. The great prophet of Islam (pbuh) says to Imam Ali (as): “You see what I see, hear what I hear, the only difference being that you aren't a prophet.”   Imam Hasan (as) says: “None of the previous prophets have fallen ahead of any of the imams in any virtue, other than the virtue of prophethood.” 
Therefore, just as the prophet of Islam (pbuh) is higher than all other prophets, the infallible imams the Shia follow are all higher than them as well, other than Prophet Muhammad (pbuh), the seal of the prophets.
For further information regarding the rank and status of the imams, the following seem to be of benenfit:
1- The characteristics of the imams in the Quran, Question 2336 (website: 2444).
2- The difference between an imam and a prophet, Question 3094 (website: 3360).
3- The advantages of Prophet Muhammad (pbuh) over the imams, Question 1381 (website: 4766).
 Seyyid Mohammad Baqir Musavi Hamedani, Translation of Tafsir Al-Mizan, vol. 1, pg. 405.
 Ibid, pg., 411.
 Majlisi, Biharul-Anwar (translation of Davani), pg. 167.
 Hasan Hasanzadeh Amoli, Ensane Kamel az Didgahe Nahjul-Balagheh, pg. 84.
 With help from Question 3218 (website: 3665).
 Kuleini, Usul Kafi (translation of Kamare’i), vol. 2, pg. 215.
 Seyyid Radhiyy, Nahjul-Balaghah, sermon 192 (Qase’ah).
 Hasan Hasanzadeh Amoli, Ensane Kamel az Didgahe Nahjul-Balaghahi, pg. 80.
 Mas’udi, Murujul-Dhahab, vol. 1, pg. 341.