A nonempty subset $M\subseteq \mathbb R^k$ is called a $m$-dimensional manifold if for every $x\in M$ there is an open neighbourhood $U\subseteq\mathbb R^k$ of $x$ and a diffeomorphims $\phi:U\to\phi(U)\subseteq\mathbb R^k$ such that $\phi(M\cap U)=\mathbb R^m\times\{0\}_{k-m}$. We will show:
If $ M\subseteq N\subseteq\mathbb R^k$ where $M$ is a $m$-dimensional and $N$ a $n$-dimensional manifold then $m\leq n$.
Note that this also implies that the rank of a manifold is well defined as you have asked here.
$\textbf{proof}:$
Let $x\in M$ and choose diffeomorphims $\phi:U\to\phi(U)$, $\psi:V\to\psi(V)$ with $x\in U\cap V$ such that $\phi(M\cap U)=\mathbb R^m\times\{0\}_{k-m}$ and $\psi(N\cap V)=\mathbb R^n\times\{0\}_{k-n}$.
For $q\leq k$ let $\text{inc}_q: \mathbb R^q\to\mathbb R^k$ and $\text{pr}_q: \mathbb R^k\to\mathbb R^q$ be the canonical inclusion and projection and set $\tilde U=\text{pr}_m(\phi(U\cap V\cap M))\subseteq\mathbb R^m
$.
Then we have a smooth map
$$J:\tilde U\xrightarrow{\text{inc}_m}\phi(U\cap V)\xrightarrow{\psi\circ\phi^{-1}}\psi(U\cap V)\subseteq\mathbb R^k$$
By construction $J(\tilde U)\subseteq \mathbb R^n\times\{0\}_{k-n}$ so $\text{inc}_n\circ\text{pr}_n\circ J=J$. The Jacobian $D(J)=D(\text{inc}_n)\cdot D(\text{pr}_n\circ J)$ has rank $m$ everywhere and so $D(\text{pr}_n\circ J)\in\mathbb R^{n\times m}$ has at least rank $m$ which implies $m\leq n$. $\square$
$\textbf{Edit:}$
$\phi(U\cap V\cap M)\subseteq \mathbb R^m\times\{0\}_{k-m}$, so
$\text{inc}_m\,(\tilde U)=\text{inc}_m\circ\text{pr}_m\circ\phi\,(U\cap V\cap M)=\phi(U\cap V\cap M)$,
$J(\tilde U)
=\psi\circ\phi^{-1}\circ\text{inc}_m\,(\tilde U)
=\psi\,(U\cap V\cap M)
\subseteq \psi\,( V\cap N)= \mathbb R^n\times\{0\}_{k-n}$