What would happen if rats from different environments came back together and could not mate and make viable offspring?
Rats that are separated long enough such that they can no longer make successful offspring have become two different species by the process of allopatric speciation. A species, by definition, is a group of individuals that can successfully interbreed, and a key factor to successful breeding is the viability of the offspring. If the rats cannot create healthy fertile offspring, then the rats are two different species.
In the real world, this process usually happens due to geographic separation; a great example is the Kaibab and Abert's squirrels, two different kinds of squirrels that were once the same species, until the Colorado River created the Grand Canyon and separated them into different populations, which are now recognized as different species. This link will take you to a lecture you can click through for more information and examples.
If the rats came together for the purpose of mating, and could not mate, for whatever reason, the chances of producing viable offspring just went down to "slim or none". The term "viable" means the offspring would have the necessary qualifications, trait-wise, to compete with the other organisms occupying their ecosystem. Think about this: if you can't even get off the ground in terms of producing offspring, the question of the offspring being viable becomes a moot point. One of the necessary requirements for a species to flourish and establish itself is that of propagation. The species must be able to replicate and produce, and pass on desirable sets of traits that make its offspring able to compete in the game of life. Not being able to produce offspring takes this set of rats off the playing field, in terms of producing viable offspring.