Let $X_1,\dots, X_n$ be iid continuous random variables with cdf $F$ with support $[a,b]$. Let $x,y\in [a,b]$ such that $x<y$. Let $k\in\{0,\dots,n\}$.
Fix some $i\in\{1,\dots,n\}$.
I would like to compute $$\mathbb{P}\Big(\text{There are exactly } k \text{ random variables }X_j \text{ other than } i \text{ such that either } (X_j>y) \text{ and } (j < i) \text{ or } (X_j>x) \text{ and }(j>i)\Big).$$
And from this compute
$\mathbb{P}\Big(\text{There are less than } k \text{ random variables }X_j \text{ other than }i \text{ such that either } X_j>y \text{ and } j<i \text{ or } X_j>x \text{ and }j>i\Big)$
(which I would do buy summing the above over $l<k$).
If simpler to solve (which I doubt), the uniform distribution case would be a start.
There are $n - 1$ random variables other than $X_i$, and we partition them into two sets: $\mathcal{X}_1 = \{X_1, X_2, \ldots, X_{i-1}\}$ with $i - 1$ random variables, and $\mathcal{X}_2 = \{X_{i+1}, X_{i+2}, \ldots, X_n\}$ with $n - i$ random variables.
When $k \leq i -1$ and $k \leq n - i$, we have
$$ \sum_{u=0}^k \binom {i - 1} {u} [1 - F(y)]^uF(y)^{i-1-u} \binom {n - i} {k - u} [1 - F(x)]^{k-u}F(x)^{n-i-k+u}$$
The first half of the summand is the probability of having exactly $u$ of $X_j \in \mathcal{X}_1$ with $X_j > y$, and the second half is similar.
When $k > i - 1$ or $k > n - i$ we just need to adjust the bounds of the summation.