Indeed there's a much simpler way in characteristic zero, with $G$ an arbitrary $k$-defined linear algebraic group.

Let $X$ be nilpotent. Fix a faithful $k$-defined linear representation $\rho$ of $G$ and let $\rho'$ be the corresponding representation of $\mathfrak{g}$.

Now $\rho'(X)$ being nilpotent, it preserves a complete flag (defined over $k$) in the linear space $\mathfrak{g}$. Let $H$ be the subgroup of $G$ preserving this flag (for the representation $\rho$), and acting as identity on all successive 1-dimensional quotients. Then, since $\rho$ is faithful, $H$ is a $k$-defined unipotent subgroup of $G$, whose Lie algebra $\mathfrak{h}$ is the subalgebra of $\mathfrak{g}$ of those element preserving the flag (for $\rho'$), and acting as zero on all successive 1-dimensional quotients. Hence $X\in\mathfrak{h}$.