An Energy and Carbon Footprint Analysis of Distributed and Federated Learning