[guided]The purpose of introducing ranks is to remove the unknown continuous distribution. Since the pooled variables are independent and identically distributed and ties have probability zero, the only information relevant to ranks is the random ordering of the labels
\begin{align*}
1,\dots,m,m+1,\dots,N.
\end{align*}
Each of the $N!$ strict orderings of these labels has the same probability, because the variables are exchangeable.
Define
\begin{align*}
A_X := \{R(1),\dots,R(m)\}.
\end{align*}
This is the set of ranks occupied by the observations labelled as $X$-observations. For any fixed $m$-element subset $A_0 \subset \{1,\dots,N\}$, the number of label orderings for which $A_X=A_0$ is $m!n!$: the $m$ labels $1,\dots,m$ may be arranged among the ranks in $A_0$ in $m!$ ways, and the $n$ labels $m+1,\dots,N$ may be arranged among the complementary ranks in $n!$ ways. Since this number is independent of $A_0$, each $m$-element subset has the same probability. Therefore $A_X$ is uniformly distributed over all $m$-element subsets of $\{1,\dots,N\}$.
It follows that
\begin{align*}
S_X = \sum_{i=1}^{m} R(i)
\end{align*}
has the same distribution as
\begin{align*}
T_{m,N}:=\sum_{r \in A} r,
\end{align*}
where $A$ is a uniformly chosen $m$-element subset of $\{1,\dots,N\}$. This is exactly the model of a simple random sample without replacement from the finite population $\{1,\dots,N\}$.[/guided]