\documentclass{jarticle}
\usepackage{amsmath}
\usepackage{accents}
\usepackage{statex}
\usepackage{shortvrb}
\MakeShortVerb{!}

\makeatletter
\def\wideubar{\underaccent{{\cc@style\underline{\mskip10mu}}}}
\def\Wideubar{\underaccent{{\cc@style\underline{\mskip8mu}}}}
\makeatother

\textwidth=9cm

\begin{document}


$
\underline{X}_i
\wideubar{X}_i
\Wideubar{X}_i
\ul{X}_i
$



\begin{align*}
& \underline{X}_i   \\
& \wideubar{X}_i    \\
& \Wideubar{X}_i    \\
& \ul{X}_i
\end{align*}


\end{document}
