You have neglected to write down the chiral angle, but that's OK, one may consider the dimensional constant $1/(2f_\pi)$ as the effective angle, since its dimensions are matched by the pions, and simply work to first order in it.
You then have
$$
\mathscr{L} = \bar{q}'(i \not\partial - {m})q'= \bar{q}\exp\left[i\dfrac{\pi \cdot \tau\gamma^5}{2 f_\pi} \right](i \not\partial - {m})\left (\exp\left[i\dfrac{\pi \cdot \tau\gamma^5}{2 f_\pi} \right]q \right )
$$
$$
=\bar{q}(i \not\partial -m)q -\bar q \left (\not\partial {\pi\over 2f_\pi}\cdot \tau \gamma^5 \right )q -m\bar q \left ( {\pi\over f _\pi}\cdot \tau \gamma^5 \right )q +O(1/f_\pi^2).
$$
Move on to the next order, now. The term proportional to m is self-evident, the second order expansion of the exponential that you have, in your target expression,
$$
{m\over 2 f_\pi^2} \bar q \pi\cdot \pi q,
$$
but your garbled target expression is incomplete!
You have omitted the term lacking m, involving the gradient of π. For that, you need this,
$$
e^{-A}\partial_\mu e^{A}= \partial_\mu A -\tfrac{1} {2} [A,\partial_\mu A]+ O(A^3),\\
A= i\pi\cdot \tau \gamma^5/(2f_\pi).
$$
Yielding the first order term, and the second order one,
$$
{1\over 4 f_\pi^2} \bar q (\pi\times \not \partial \pi )\cdot \tau q + O(1/f_\pi^3).
$$
This cross-product term is the one you missed!
\not
to get a slashed notation though it's not perfect like this\not \partial
to get $\not\partial$ $\endgroup$