An $r\times r$ submatrix of independent rows and independent columns is invertible (Michael Artin's book).
We may pre- and post- multiply by permutation matrices, so without loss assume that $I=J=\{1,2,\ldots, r\}$. Because the row-rank of the first $r$ rows is $r$, and the row-rank of $A$ is also $r$, all other rows of $A$ are linear combinations of the first $r$ rows. Suppose by way of contradiction that $M$ is not invertible; then its row rank is less than $r$. Hence we may do elementary row operations on the first $r$ rows, making an all-zero row within $M$.
Now we turn our attention to the columns. Because the column-rank of the first $r$ columns is $r$, and the column-rank of $A$ is also $r$, all other columns of $A$ are linear combinations of the first $r$ columns. None of this is disturbed by the elementary row operations done in the previous paragraph. But now all linear combinations of the all-zero row remain zero, so in fact $A$ has an all-zero row among the first $r$ rows (after the work in the previous paragraph). This is a contradiction.