Although, Namaz is Imambargah is valid and permissible but to pray in Masjid is more appreciated and worthy of greater reward. The reason is simple: Masjid is considered as the house of Allah swt and Imambargah is considered as a sign and a sacrament of Allah swt (Quran: 22:32). Its obvious that a house is more important than the sign towards the house!
There are numerous ahadith on the importance of prayers in masajid. For instance, Imam Ali (as) is reported to have said in a sermon that a person not praying jamat in Masjid is not supposed to be kept relation with him and is eligible to severe punishment. Al- amali (al Tusi) Pg 696.
The concept of Imambargah was not established at the time of Imams so you would not find any direct verse or hadith where a comparison would have been made on the preference of prayers in one over the other.