What's the main purposes, objectives and duties of a Shia Imam?
Do those purposes, objectives and duties get over when he passes away? And is it possible that he not be able to complete all his objectives and pass away?
How does Satan misguide people? Many people at once... Who is there set by Allah to guide people against Satan at once?
Who is there to guide people for every era and age? Shouldn't there be one who does have that power as well?
The messengers (Hujjats) of Allah have always been there to guide people... ALL people in the world... even though if they aren't physically present in the place you are... but just as Satan can, so can they.
That is why for everything that we want to do we say اعوذ بالله من الشیطان الرجیم... that we want to be pure for everything that we do... and we need Allah's guidance... and it is in Allah's tradition to always constantly have his guidance done by his hujjats... as they are بَابُ ٱللَّهِ ٱلَّذِي مِنْهُ يُؤْتَىٰ, سبب متصل بین الارض و السماء... (From Dua Nudba).
Just don't get me wrong that this is Shirk... no not at all. They have this ability only because Allah has given it to them... they have nothing by their own.
This belief is for all of Allah's messenger... as Allah always needs to have complete guidance for human beings otherwise on the day of judgement people can come and say... you didn't send down any messenger to us...and we weren't told of what is right and what is wrong.
As long as there is a Satan... then humans do need one against him... that is why Allah has sent 124,000 messengers and some more Imams... And if there wasn't a Satan... still we as human beings would have needed some person to tell us about the heavens and how to achieve جنه ... in the same way that if we want to take a path we need a navigator (There is a similar quote from Imam Ali)
Right now if you bring 1000 people to a gathering... all would their own approach. Is all 1000 approaches correct? Definitely not. We need someone who Allah has chosen and has been granted with absolute correctness, one who is absolutely on the الصراط المستقیم...
In regard to the duty of Shia Imams, it could be so long to illustrate regarding it completely. But briefly speaking, the Prophet (peace be upon him and his family) is bringer of the religion, and the Imams of Shia are its keepers (The keepers of the religion). On the other hand, according to Shia, Prophet Muhammad (SAWW) gave the scientific legacy of Prophecy to Imam Ali (pbuh) and asked him to state the expression of the Ma'refah and religious Ahkam and do the tafseer of Qur'an; Then he (imam Ali) hand it to the next Imam, … till it reach Imam Mahdi.
They had some other duties such as:
With respect to the other part of your inquiry that inquired “Do those purposes, objectives and duties get over when he passes away?”, I should explain that as far as I know, their way could be continued in the lower lever such as Wali-al-Faqih who can continue their objectives and manners as much as they can (in a lower). Besides, their way could be carried out by referring to Marja’al-Taqids and hadiths of them as well.