I don't think this is a "deep explanation," but if you set up the equation
$$
m(x_1 + 2x_3) = a(x_1 + x_2 + 4x_3) + b(2x_1 - x_2 + 2x_3)
$$
you obtain the relations $m = a+2b$, $0 = a - b$, and $2m = 4a+2b$. This system reduces to $m = 3a$. There's probably a slick way to do it using matrices.
Edit: A slick method using matrices, a little under 3 years too late! The key ingredient is the Smith normal form of a matrix: see here for more on the general theory.
Computing the Smith normal form of the relations matrix $M$ (whose columns are the coefficients of the generators of $B$), we find
$$
\underbrace{
\begin{pmatrix}
0 & 1 & 0 \\
1 & -1 & 0 \\
2 & 2 & -1
\end{pmatrix}
}_P
\underbrace{
\begin{pmatrix}
1 & 2\\
1 & -1\\
4 & 2
\end{pmatrix}
}_M
\underbrace{
\begin{pmatrix}
1 & 1 \\
0 & 1
\end{pmatrix}
}_Q
=
\underbrace{
\begin{pmatrix}
1 & 0 \\
0 & 3 \\
0 & 0
\end{pmatrix}
}_D \, .
$$
This gives us the isomorphism
$$
\frac{A}{B} \cong \frac{\mathbb{Z} w_1 \oplus \mathbb{Z} w_2 \oplus \mathbb{Z} w_3}{\mathbb{Z} w_1 \oplus \mathbb{Z} 3 w_2} \cong \frac{\mathbb{Z}}{3\mathbb{Z}}w_2 \oplus \mathbb{Z} w_3 \cong \frac{\mathbb{Z}}{3\mathbb{Z}} \oplus \mathbb{Z} \, .
$$
Moreover, the matrix $P$ tells us the basis $\{w_1, w_2, w_3\}$ with respect to which we have this isomorphism. Since
$$
P^{-1}=
\begin{pmatrix}
1 & 1 & 0 \\
1 & 0 & 0 \\
4 & 2 & -1
\end{pmatrix}
$$
then
$$
w_1 = x_1 + x_2 + 4 x_3,\quad w_2 = x_1 + 2 x_3,\quad w_3 = -x_3
$$
where $\{x_1,x_2,x_3\}$ is the standard basis for $\mathbb{Z}^3$. The element $w_2 = x_1 + 2 x_3$ should look familiar: it is the element whose order in the quotient we are trying to compute! Since the image of $w_2$ generates the factor $\mathbb{Z}/3\mathbb{Z}$, then it has order $3$, as we previously found.