When trying to consider rotating frames you can easily get confused by the rotations and the notation. I struggled with this, until I decided to take a step by step approach when dealing with a serial chain of rigid bodies each with a relative rotation about a single axis. The key here is to move from the absolute rotations to relative rotations such that
$$ \begin{align} \vec{\omega}_1 & = \hat{x} \dot{q}_1 \\
\vec{\omega}_2 & = \vec{\omega}_1 + \hat{z} \dot{q}_2 \end{align} $$
where the relative (scalar) rotations are $\dot{q}_1 = 5$ and $\dot{q}_2= 4$. Now to differentiate the above you have to consider on which frame are the unit axes $\hat{x}$ and $\hat{z}$ rotating about. For each body the rotation axis moves with the previous body such that
$$ \begin{align} \dot{\hat{x}} & = \vec{\omega}_{ground} \times \hat{x} = 0 \\ \dot{\hat{z}} & = \vec{\omega}_1 \times \hat{z} = (\hat{x} \times \hat{z}) \dot{q}_1 \end{align}$$
So the rotational accelerations are
$$ \begin{align} \vec{\alpha}_1 &= \dot{\hat{x}} \dot{q}_1 + \hat{x} \ddot{q}_1 =0 \\
\vec{\alpha}_2 & = \vec{\alpha}_1 +\dot{\hat{z}} \dot{q}_2 + \hat{z} \ddot{q}_2 = (\hat{x} \times \hat{z}) \dot{q}_1 \dot{q}_2 \end{align} $$
since $\ddot{q}_1 =0$ and $\ddot{q}_2 = 0$ due to the constant rates. You will find that $\hat{x} \times \hat{z} = -\hat{y}$.