Suppose $f: [0,1] \times [0,1] \to \mathbb{R}$ is a differentiable function. Define $g(t) = f(0,t)$ and suppose that $g$ has a maximum in $t_0 \in (0,1)$, and suppose additionally that $D_1f(0,t_0) < 0$. I need to either prove, or give a counter-example to the fact that then $(0,t_0)$ is a local maximum of $f$.
Firstly it follows that $g'(t_0) = D_2f(0,t_0) = 0$. I have set up the Taylor expansion, write $\vec{a} = (0,t_0)$, then: $$ f(\vec{a} + \vec{h}) = f(\vec{a}) + D_1f(\vec{a})h_1 + D_2(\vec{a})h_2 + o(\|\vec{h}\|) = f(\vec{a}) + D_1f(\vec{a})h_1 + o(\|\vec{h}\|). $$ Now if $h_1 < 0$ it seems that $f(\vec{a} + \vec{h}) > f(\vec{a})$, or at least has the potential to be greater, so my guess is that it does not hold and we need to specify a counter-example. I have tried several but everything fails.
Let's build $f$ such that $g(t) = t-t^2$ (which attains its maximum at $t_0 = \dfrac12$) but which increases with $x$.
For this purpose, let's try $f(x,y) = x + y - y^2$. When we fix a value for $x$, the graph is simply the same parabola but translated to the top by $x$ (see below the drawing in $\Bbb R^3$ of the surface $z = f(x,y)$).
In this case, $f(0,0.5) = g(0.5) = 0.25$ but $f(1,0.5) = 1.25$ so that $(0,0.5)$ isn't a point of maximum of $f$.
Edit: I did not see the condition $D_1f(0,t_0)<0$. Thus I propose a new counterexample $f(x,y) = x^2-\dfrac12 x+y-y^2$ (see the new picture below).
Here, the idea was to add a function of $x$ (that is, $x^2-x$ here) which begins by decreasing when $x$ increases from 0 (in particular, $D_1f(0,0.5) = -\dfrac 12<0$) and then has a sufficiently strong increase when $x$ approaches $1$ so that $f(1,0.5)>f(0,0.5)$.