Traffic congestion is one of the major challenges faced by the transportation industry. While this problem carries a high economical and environmental cost, the need for an efficient design of optimal paths for passengers in multilayer network infrastructures is imperative. We consider an approach based on optimal transport theory to route passengers preferably along layers that are more carbon efficient than the road, e.g. rails. By analyzing the impact of this choice on performance, we find that this approach reduces carbon emissions considerably, compared to shortest-path minimization. Similarly, we find that this approach distributes traffic more homogeneously thus alleviating the risk of traffic congestions. Our results shed light on the impact of distributing traffic flexibly across layers guided by optimal transport theory.