Here is an easy and common scenario. Suppose the $X_i\in\mathcal X$ are continuously distributed with distributions depending on a parameter $\theta=\theta(X_i)$ so that $$\theta(X)\ge\theta(Y)\qquad\Longrightarrow\qquad\Pr(X\ge y)\le\Pr(Y\ge y)\quad\forall y.$$ Then for $X,Y\in\mathcal X$, $\theta(X)\ge\theta(Y)$ if and only if $$ \Pr(X\ge Y)=\int_{-\infty}^\infty \int_y^\infty f_X(x)f_Y(y)\,dx\, dy =\int_{-\infty}^\infty \Pr(X\ge y) \,f_Y(y)\, dy$$ $$ \ge\int_{-\infty}^\infty \Pr(Y\ge y) \,f_Y(y)\, dy=\int_{-\infty}^\infty \int_y^\infty f_Y(x)f_Y(y)\,dx\, dy= \frac12.$$ Hence the $X_i$ inherit the order of the numbers $\theta(X_i)$, and so are totally ordered.