Try 
$A=\begin{bmatrix}0 & 1\\\\ 1 & 0\\\\ 0 & 0\\\\ 0 & 0\\\\ 0 & 0\end{bmatrix}$ and $B=\begin{bmatrix}0 & 1\\\\ 0 & 0\\\\ 1 & 1\\\\ 0 & 0\\\\ 0 & 0\end{bmatrix}$. Then $rank([A,B])=3$ but $rank(A)=rank(B)=2$.