Vertical equivalent for \overbrace and \underbrace

One way to do it:

\left.
\begin{array}{rrr}
a\\
a\\
a\\
a\\
a
\end{array}
\right\}\text{Segment a}

Output:

enter image description here

EDIT: I see, in your case, you will want to use bigdelim package, for example:

\documentclass{article}
\usepackage{multirow,bigdelim}

\begin{document}

\[
\begin{array}{cc}
a&\rdelim\}{5}{1em}[Segment a]\\
a\\
a\\
a\\
a\\
b&\rdelim\}{5}{1em}[Segment b]\\
b\\
b\\
b\\
b\\
\end{array}
\]

\end{document}

will give you:

enter image description here


Improving the @Francis's code, you can use two rows with two blocks.

\[
\begin{array}{r}
\left. \begin{array}{r}
a\\
a\\
a\\
a\\
a
\end{array}
\right\}\text{Segment a} \\
\left. \begin{array}{r}
b\\
b\\
b\\
b\\
b
\end{array}
\right\}\text{Segment b}
\end{array} 
\]

enter image description here


Another way using the rcases environment from mathtools

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\noindent
$
    \begin{rcases}
        a\\a\\a\\a\\a
    \end{rcases}
    \text{Segment A}
$\\
$
    \begin{rcases}
        b\\b\\b\\b\\b
    \end{rcases}
    \text{Segment B}
$
\end{document}

enter image description here