Notation becomes a bit less cluttered, if we write $\lambda := \lambda_1$ and $\rho := \lambda_2/\lambda_1$, that is, $\lambda_2=\rho\lambda$. Since the term $\log(x_1!x_2!)$ does not change the maximizer, we will then find the values $\rho, \lambda)$ that maximize $$ h(\lambda, \rho) = - \lambda(1+\rho) + x_1\log \lambda + x_2\log(\lambda\rho) $$ We find the root of $$ \frac{\partial h(\lambda,\rho)}{\partial\lambda}=-(1+\rho)+\frac{x_1+x_2}{\lambda}=0 $$ as $$\hat\lambda = \frac{x_1+x_2}{1+\rho},$$ and double checking the second partial derivative of $h$, we convince ourselves that this is actually a maximizer. Plugging it in to $h$, we get $$ h(\hat\lambda,\rho)=x_2\log\rho - (x_1+x_2)\log(1+\rho)-(x_1+x_2)+(x_1+x_2)\log(x_1+x_2), $$ and from there $$ \frac{\partial h(\hat\lambda,\rho)}{\partial \rho}=\frac{x_2}{\rho} -\frac{x_1+x_2}{1+\rho}=\frac{x_2-\rho x_1}{\rho(1+\rho)}. $$ The function $\rho\to h(\hat\lambda,\rho)$ takes one local maximum in $\rho = x_2/x_1$. $$\hat\rho = x_2/x_1.$$
- If $x_1>x_2$, then $\hat\rho = x_2/x_1$ is the maximizer also under the constraint, and we get $$\hat\lambda_1 = x_1\quad \text{and}\quad \lambda_2 = x_2.$$$$\hat\lambda_1 = x_1\quad \text{and}\quad \hat\lambda_2 = x_2.$$
- If $x_1\leq x_2$, then the local maximizer $x_2/x_1 \geq 1$. As $h$ is increasing in $\rho$ for $\rho\leq 1 \leq x_2/x_1$, choose $\hat\rho$ as large as allowed, so here: $\hat\rho = 1$, which gives $$ \hat\lambda_1 = \hat\lambda_2 = (x_1 + x_2)/2. $$