First here the length over $\mathcal{O}_P$ coincide with lenth over $k$ that is the dimension over $k$ (cf Atiyah-MacDonald 6.10).
taking $m=\mu_P(X)$ and $n=\mu_P(Y)$ (notation of Hartshorne ex I.5.4), and suppose that $m\leqslant n$. Then we have in $k[X,Y]/(f,g)$:
- 1 degree 0 monomial which is not in $(f,g)$: the constant 1
- 2 degree 1 monomials which are not in $(f,g)$: $x$ and $y$
- $\ldots$
- $m$ degree $m-1$ monomials which are not in $(f,g)$
- $m$ degree $m$ monomials which are not in $(f,g)$: we could have $f_m\in (f,g)$
- $m$ degree $m+1$ monomials which are not in $(f,g)$: we could have $x f_m$ and $y f_m$ in $(f,g)$
- $\ldots$
- $m$ degree $q$ monomials which are not in $(f,g)$: because between the $q+1$ monomials of degree $q$ there are the $f_m\times$(monomials of degree $q-m$) that could be in $(f,g)$: that make $q+1-(q-m+1)$ monomials ie $m$ monomials.
- $\ldots$
- $m$ degree $n-1$ monomials which are not in $(f,g)$: idem
- $m-1$ degree $n$ monomials which are not in $(f,g)$: there are the $m$ usuals monomials without $g_n$ which could be in $(f,g)$
- $m-2$ degree $n+1$ monomials which are not in $(f,g)$: the $m$ usuals without $xg_n$ and $y g_n$.
- $\ldots$
- $1$ monomial of degree $n+m-1$ which is not in $(f,g)$: following the same logic
From here this is a simple calculus, for example
$$ (1+2+\ldots+m)\times 2+m\times(n-m+1)=m\times(m-1)+(n-m+1)\times m=nm $$
which says that there is in $k[X,Y]/(f,g)$ $nm$ independant monomials (over $k$). This gives $mn$ independants elements in $\mathcal{O}_P/(f,g)$ so the dimension is greater than $mn$.
I guess there should be some more conceptual and short answer.