Learn More by Using Less: Distributed Learning with Energy-Constrained Devices