You should be fine with two firemouths. They should get along, they can be considered to be peaceful. From my experience, they typicaly are not peaceful, but they will co-exist especailly in a 40g, there will be plenty of space. And with reguards to your rainbows, they are pretty sizeable and fast, they wont' have any problems surviving.