By construction the Jordan block $J$ for$~\lambda_i$of size $m_i$ contains a vector $v$ such that the vectors $v$, $(A-\lambda_iI)(v)$, ... $(A-\lambda_iI)^{m_i-1}(v)$ form a basis of$~J$, and with $(A-\lambda_iI)^{m_i}(v)=\vec0$. So certainly the $m_i$-th power of $A-\lambda_iI$ is the smallest one that will annihilate this Jordan block$~J$. At le same time it will annihilate all other (smaller) Jordan blocks for$~\lambda_i$. Any *other* factors in the product forming $m(A)$ act in an invertible way on the generalized eigenspace $V_{\lambda_i}$ for $\lambda_i$ (the kernel of the restriction of such a factor to$~V_{\lambda_i}$ is zero), and in particular on$~J$, so their presence makes no difference for annihilating$~J$.

Therefore, if you take for every eigenvalue as exponent the maximum size of a corresponding Jordan block, you do annihilate all generalized eigenspaces. Since you assumed that these generalised eigenspaces span everything (i.e., there exists a Jordan normal form, which means the minimal (and characteristic) polynomial is split), you have your minimal polynomial.