Mixing two ideal gases
Because you aren't told, there are three possible cases to consider (well there's more, but these are the natural cases):


Two monoatomic Gases
One monoatomic and one diatomic gas
Two diatomic gases


We should just note that the equilibrium for this system will be the state at which the temperature of each system is equal. We want to find where that temperature ends up between $T_1$ and $T_2$. Let's call this $T_f$. So we have,$$T_1\le T_f\le T_2.$$

Also note that this a constant volume process not a constant pressure one.

$\textbf{Two Monoatomic Gases}:$

The heat capacity of a monoatomic ideal gas is simply $C_v=\frac{3}{2}nR$.

Then, the internal energy of the system at a given temperature is,$$U=\frac{3}{2}nRT.$$
Then, the change in internal energy of one system is the negative of the change in internal energy of the other,$$\Delta U_1=-\Delta U_2$$so that,$$\frac{3}{2}nR(T_f-T_1)=\frac{3}{2}nR(T_2-T_f)$$
Upon rearranging this yields,
$$T_f=\frac{T_2+T_1}{2}$$which gives the (perhaps) intuitive result that the final temperature the gases is simply the average of the two initial temperatures for the fairly restrictive conditions we have here.

$\textbf{One Monoatomic and One Diatomic:}$

The only thing different here is that the heat capacity of a diatomic gas is $C_v=\frac{5}{2}nR$. That is, we pick up an extra $\frac{1}{2}k_bT$ for each rotational degree of freedom per molecule.

It is still gonna be true that changes in energy are equal and opposite so we can skip straight to that step and write,
$$\frac{5}{2}nR(T_f-T_1)=\frac{3}{2}nR(T_2-T_f)$$but we see now that it actually matters now whether the hotter or colder bath had the diatomic molecules. For the expression above, let's say $T_1$ was colder than $T_2$. This gives,
$$T_f=\frac{3}{8}T_2+\frac{5}{8}T_1$$
And by the symmetry of the situation, if the diatomic gas started at the hotter temperature $T_2$, we just switch the coefficients and get,
$$T_f=\frac{5}{8}T_2+\frac{3}{8}T_1$$

This basically tells us that the system with the larger heat capacity needs more energy input than the other.

$\textbf{Two Diatomic Gases}$

Well, this actually ends up being exactly the same as the monoatomic gas case as I'm sure you can convince yourself. So, here the final temperature is simply the average of the initial temperatures as well.

$\textbf{Further Cases}$

Note that I used a linear diatomic which only has two rotational degrees of freedom, but one could easily imagine using water vapor which has three rotational degrees of freedom and combining this with a diatomic or a monoatomic. The form of the answer is always gonna be the same as above though. Just two coefficients in front of the initial temperatures which sum to one.

I'm pretty sure I haven't gone astray, but if I have I'm sure someone will promptly inform me :)



Edit:

It just dawned on me that the question title and the body of the question don't say the same thing. That is, letting two systems of gases equilibrate by heat exchange is different than having them separated and allowing them to mix. I haven't really thought about it, but because the initial volumes of the containers are the same, the answer might be the same as what I write above, but the answers probably aren't the same in general.

Maybe someone else can answer the gas-mixing case.