Federated Learning Framework for Scalable AI in Heterogeneous HPC and Cloud Environments