Answer
(Fatwa: 1844/L=534/tl=1431)
Polytheistic acts are of two types. The first type of the acts are ones which the Ulama explained with proper justifications and did not declare its doer as Kafir. Performing salah behind such an imam is allowed but with karahat tahrimi. Most of the Barelvis and Bid?atis are involved in this type of Shirk. That is why our elder Ulama have not regarded them as kafir. The second type of the acts are ones which could be given a justifiable proper explanation. One who is involved in such type of acts, his imamah is not right and performing salah behind him is not valid. Now, you can make it clear by your own observation that in what type of shirkiya (polytheistic) acts they are involved. If they are in the first category, as the common Barelvis and Bid?atis, then you can perform salah behind him and if that Imam is involved in open shirk, you should not offer salah behind him. In such case, you should go to the mosque after performing your salah with jamah and offer salah. However, the imamah of both types of the imam is doubtful. Therefore, it would be better for you to offer least salah in the mosque and perform only those salah in which there are more people. This is our opinion. After all, you too can adopt any better and effective method according to the situation.
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband