There's been some trials of battery-powered trainer aircraft. The last I checked, they still don't have enough range to do the "long" cross country that's legally required.
And I assure you it's not because of old aircraft. Some flights schools have fleets of brand new 2025/26 models - all of them still run on leaded avgas.