Taking the sup inside the expectation for an infinite collection of random variables Let $(X_t)_{t \in T}$ be an infinite collection of real-valued random variables, where $T$ is a topological space (not necessarily countable).
Under which conditions on $t \rightarrow X_t$ and on $T$ it true that
$$
\sup_{\substack{K \subset T: \\ |K| < \infty }} \mathbb{E} \big ( \sup_{t \in K} X_t   \big ) = \mathbb{E} \big ( \sup_{t \in T} X_t   \big ).
$$
where $\mathbb{E}$ is the expectation. Is continuity of the function $t \mapsto X_t(\omega)$ for example necessary/sufficient? Do we need $T$ to be separable?
It seems to me that one direction is always true:
$$
\sup_{\substack{K \subset T : \\ |K| < \infty }} \mathbb{E} \big ( \sup_{t \in K} X_t   \big ) = 
\sup_{\substack{K \subset T : \\ |K| < \infty }}\int d P(\omega) \, \, \sup_{t \in K} X_t(\omega)
\leq 
\sup_{\substack{K \subset T: \\ |K| < \infty }}\int d P(\omega) \, \, \sup_{t \in T} X_t(\omega)
= \mathbb{E} \big ( \sup_{t \in T} X_t   \big ).
$$
 A: One direction is true as you showed. Further
$$\mathbb{E} \big ( \sup_{t \in \mathbb{R}^n} X_t)=\int dP(\omega) \sup_{t\in \mathbb R^n }X_t(\omega)$$
Let now $t\in\mathbb R^n$, then also $t\in K_i \subseteq \mathbb R^n$ for some $K_i\rightarrow \mathbb R^n$, (in fact we can choose $K_i=\cup_{j´\leq i} t_j$). Then
$$\leq\int dP(\omega)\lim_{i\rightarrow \infty} \sup_{t\in K_i }X_t(\omega)$$
And we are left with exchanging a limit and integral. As noted by the comment, this is the dominated convergence or monotone convergence theorem. Hence if $\sup_{t\in K_i }X_t(\omega)$ is bounded or monotonically increasing, we have
$$=\sup_{\substack{K \subset \mathbb{R}^n : \\ |K| < \infty }} \mathbb{E} \big ( \sup_{t \in K} X_t   \big ).$$
A: We can bypass the conditions imposed by the dominated convergence theorem or monotone convergence theorem if $X_0 \geq C$ for some constant $|C| < \infty$ (this is almost always satisfied since most processes are deterministic at time $0$ and the supremum can only increase from there).
As you noted, if $\sup_{t\in T} X_t$ is measurable and $\mathbb{E}[\sup_{t\in T} X_t]$ exists, then one side is trivial.
For the other side (I'm assuming here that $T$ is a subset of the real axis that includes $0$), you want to assume for example that the paths of $X$ are càdlàg almost-surely (this is less restrictive than continuity, for instance, all Levy processes are càdlàg), so that $\sup_{t\in T} X_t = \sup_{t\in T\cap \mathbb{Q}} X_t$ almost-surely, where $\mathbb{Q}$ is the set of rational numbers.
Then, by Fatou's lemma:
\begin{align*}
\mathbb{E}\Big[\sup_{t\in T} X_t\Big] - C
&= \mathbb{E}\Big[\sup_{t\in T\cap \mathbb{Q}} (X_t - C)\Big] \\
&= \mathbb{E}\Big[\lim_{n\to \infty} \sup_{t\in K_n} (X_t - C)\Big], \quad \text{where } K_n := T \cap \mathbb{Q} \cap [-n,n] \\
&\stackrel{\mathrm{Fatou}}{\leq} \liminf_{n\to \infty} \, \mathbb{E}\Big[\sup_{t\in K_n} (X_t - C)\Big] \\
&\leq \sup_{K\subseteq T : |K| < \infty} \mathbb{E}\Big[\sup_{t\in K} (X_t - C)\Big] \\
&= \sup_{K\subseteq T : |K| < \infty} \mathbb{E}\Big[\sup_{t\in K} X_t\Big] - C,
\end{align*}
where the last inequality follows from the fact that $K_n$ is a specific finite subset of $T$.
