No curve between two points on a Riemannian manifold ever maximizes arc length. Given any curve $\gamma$ from $p$ to $q$, you can always find a longer curve, e.g. by leaving $\gamma$ for a little while and taking a detour, and then coming back and rejoining $\gamma$ where you left off.
The dashed curve in your drawing is a saddle point for the distance function. You can envision the space of all smooth curves with the same endpoints as a sort of infinite-dimensional manifold; in that manifold, this is a saddle with a 1-dimensional space of directions in which the distance function decreases, and an infinite-dimensional space of directions in which it increases.
The Morse index theorem says that every geodesic segment has at most a finite-dimensional space of directions in which distance decreases (the dimension of this space is called the index of the geodesic), and the index is equal to the number of interior points along the geodesic that are conjugate to one endpoint, counted with multiplicity. (Roughly speaking, you can think of two points being conjugate along a geodesic if there's a 1-parameter family of geodesics between the same two points. This is not exactly right, but thinking of it that way will give you a good intuition about conjugate points.)
On the sphere, two points are conjugate along a geodesic if and only if they are antipodal points. The dashed geodesic in your drawing contains one interior point that's conjugate to the starting point (namely the point antipodal to the starting point), and therefore it has index 1.