The entropy of $N$ molecules of an ideal gas in a volume $V$ at temperature $T$ can be expressed as:
$$S(N, V, T) = N k\log\left(\frac{V}{V_0}\right) + C_v\log\left(\frac{T}{T_0}\right) + S(N, V_0,T_0)$$
Here $V_0$ and $T_0$ define arbitrary standard conditions at which the entropy is known, and $C_v$ is the total heat capacity at constant volume. To derive this formula, you can consider the change in entropy from the standard conditions to the final state using an isothermal process at constant pressure where heat is added to the system, thus yields the first term. After that we can change the temperature from $T_0$ to $T$ by adding heat to the system at constant volume, the entropy change due to that process is given by the second term.
The initial entropy of the system can thus be expressed as:
$$S_{\text{initial}} = S(N,V_1,T_i) + S(N,V_2,T_i) = N k\log\left(\frac{V_1V_2}{V_0^2}\right) + 2C_v\log\left(\frac{T_i}{T_0}\right) + K$$
where $K$ is a constant (for problems where the total number of molecules in the system does not change). The final state will be a state where the molecules are (or can be considered to be) in a volume of $V_1 + V_2$ at some temperature $T_f$. If no work can be extracted anymore the gases in the two boxes must be in thermal equilibrium with each other and then doesn't matter whether or not there is a separation between the gases. The final entropy is thus given by:
$$S_{\text{final}} = S(2N,V_1+V_2,T_f) = 2N k\log\left(\frac{V_1+V_2}{V_0}\right) + 2C_v\log\left(\frac{T_f}{T_0}\right) + K$$
Then for any process involving only the two boxes, $S_{\text{final}}\geq S_{\text{initial}}$. The maximum amount of work we can extract from the system is obtain in the reversible case where the entropy stays the same. We can see this by considering two processes, one where the entropy increases and one where it stays the same. Then we can go from the latter to the former by dumping energy extracted in the form of work as heat into the system at constant volume of $V_1+V_2$ until we reach the same entropy as the former system (and as a result also the final temperature of the latter system, as volume, entropy and number of molecules completely determine the thermodynamic state of the system). Since we've then thrown away work to arrive at the former end state, with entropy increase you're alway worse off then when the entropy stays the same.
To find the maximum amount of work, we thus need to equate $S_{\text{final}}$ to $S_{\text{initial}}$, we can then solve for $T_{f}$, the drop in the internal energy is then the maximum amount of work extracted from the system (note that no heat can have been added or extracted from the system, because the total entropy has stayed the same, therefore the entire internal energy change is due to work). Solving for $T_f$ yields:
$$T_f = T_i \left(\sqrt{\frac{V_2}{V_1}}+\sqrt{\frac{V_1}{V_2}}\right)^{-\frac{N k}{C_v}} = T_i \left(\sqrt{\frac{V_2}{V_1}}+\sqrt{\frac{V_1}{V_2}}\right)^{1-\gamma}$$
where we've used that $C_V = \dfrac{f}{2}N k$ and $\gamma = \dfrac{f+2}{f}$ where $f$ is the effective number of degrees of freedom per molecule.
The total amount of work $W$ that can be extracted is therefore equal to:
$$W = 2 C_V (T_i - T_f) = \frac{2N kT_i}{\gamma - 1}\left[1-\left(\sqrt{\frac{V_2}{V_1}}+\sqrt{\frac{V_1}{V_2}}\right)^{1-\gamma}\right] $$
(a) $$\sum \text{translational KEs of molecules} =N \times \tfrac12 m c_{rms}^2=\tfrac12 N m c_{rms}^2$$
But
$$pV=\tfrac13 N m c_{rms}^2$$
So the correct relationship for an ideal gas is
$$\text{Total translational KE} =\tfrac32pV$$
(b) Dalton's law states that the pressure exerted by a mixture of gases (in a container) is the sum of the pressures that would be exerted by each gas if it were the only gas in the container. So the law doesn't say anything about what happens when you mix gases at different temperatures. The gases that the law deals with are already mixed and therefore at the same temperature!
(c) When you talk of your textbook proving Dalton's law, you mean, I think, deriving it from the kinetic theory of ideal gases. You can do the derivation without considering the sum of molecules' kinetic energies. You simply extend the assumption of additivity of momentum changes due to molecules' impacts with the wall to include molecules of different species but with the same $m c_{rms}^2$.
(d) At the end of your question you assume that when you mix two gases at different temperatures the temperature rise of one gas is equal to the temperature fall of the other. This will not, in general, be true. Just think of what would happen if you mix 10 mole of a hot gas with 1 mole of a colder gas. It is, of course, the case that both gases will end up at the same temperature.
(e) How should one find an expression for the final pressure of equal volumes, $V$, of two gases at different temperatures and pressures when mixed together and confined to a volume, $V$?
You know that the number of moles is conserved. Hence, using the ideal gas equation, you can find a relationship involving just pressures and temperatures.
But the confinement won't take place spontaneously, as you suggest: "Consider another container with the same volume and slowly mix these both gases from those containers into this new one." You'll have to do work to squash 2 volumes $V$ of gas into volume $V$. This stops internal energy being conserved even if the mixing is adiabatic, so a nice easy equation is denied you.
But internal energy would be conserved if the final volume of the mixture were allowed to be $2V$, provided that the mixing were adiabatic. If you further assume that the molar heat capacity of the two gases is the same, you get a very simple result for the final pressure in terms of the initial pressures.
Best Answer
Prepare different gases, each on a container with a piston and a barometer. Fill the containers at constant temperature with the same number of moles for each gas. Modify the height of the piston until they all reach the same pressure. The volume in each container should now be the same.