The brain prospectively minimizes the local somato-dendritic mismatch error within individual neurons to produce appropriate behavioral outputs in real-time, based on a neuronal least-action principle.
Stochastic gradient descent may indeed play a role in optimizing biological neural networks, even though the learning process relies only on local information.