[guided]For each $N$, let $R_{N,i}$ denote the rank of $X_{N,i}$ among the $N$ pooled observations, and define $S_N=\{R_{N,1},\dots,R_{N,m_N}\}$ as the subset of $\{1,\dots,N\}$ occupied by the observations from the first sample. The continuity assumption is used here and only here: since the common distribution is continuous, the probability that two pooled observations are equal is zero. Therefore the pooled observations have a strict ordering with probability one.
On this no-tie event, the $N$ observations are independent and identically distributed, so their labels are exchangeable. Equivalently, every permutation of the $N$ labels among the ordered positions has the same probability. Since there are $N!$ possible strict orderings, each ordering has probability $1/N!$.
Now fix a subset $A\subset \{1,\dots,N\}$ with $|A|=m_N$. The event $S_N=A$ says exactly that the $m_N$ observations labelled $X$ occupy the ordered positions in $A$, while the $n_N$ observations labelled $Y$ occupy the complement $\{1,\dots,N\}\setminus A$. Once the positions in $A$ are fixed, the $X$ labels may be assigned to those positions in $m_N!$ ways, and the $Y$ labels may be assigned to the remaining positions in $n_N!$ ways. Hence
\begin{align*}
\mathbb{P}(S_N=A)
=
\frac{m_N!n_N!}{N!}
=
\binom{N}{m_N}^{-1}.
\end{align*}
This probability is the same for every subset $A$ of size $m_N$, so $S_N$ is a uniformly chosen subset of $\{1,\dots,N\}$ with cardinality $m_N$.[/guided]