The mode of a given random variable is a quantity that depends on the distribution of $X$, not only $X$, which is a measureable function from the sample space $\Omega$ to $\mathbb R$. For example, the quantity $\sup(X)=\sup_{\omega \in \Omega}X(w)$ depends only on $X$, so the method in the OP works, that is, $$\sup \left (e^X \right)=e^{\sup(X)}.$$
Thus, to check when the method given in the OP works for the mode, we need to focus on the original definition of mode, which is a distribution-dependent concept.
For discrete random variables, the method in the OP works because we have $$\mathbb P(X=m) \ge \mathbb P(X=x), x\in S_X \Leftrightarrow \mathbb P(e^X=e^m) \ge \mathbb P(e^X=e^x), e^x\in S_{e^X}.$$
In other words, $$\color{blue}{p_{e^X}(t)}=\mathbb P(e^X=t) =\mathbb P(X=\log t)\color{blue}{=p_{X}(\log t)}, t\in S_X;$$
hence, $p_{e^X}(t)$ preserves the order based on which the mode of $X$ is obtained, and if the point $m$ maximizes $p_{X}(x)$, $e^m$ maximizes $p_{e^X}(t).$
For continuous random variables, the method does not work because we cannot prove the following
$$ f_X(m) \ge f_X(x), x\in S_X \Leftrightarrow f_{e^X}(e^m) \ge f_{e^X}(e^x), e^x\in S_{e^X}.$$
The reason is that $f_{e^X}(t)$ is not $f_{X}(\log t)$, and is given by
$$\color{blue}{f_{e^X}(t)=\frac{1}{t} \times f_{X}(\log t)}, t>0$$
which does not preserve the order because of the term $\frac{1}{t}$, which is a decreasing function in $t$. Hence, if the point $m$ maximizes $f_{X}(x)$, $e^m$ does not necessarily maximize $f_{e^X}(t).$