Canadian prime minister’s legacy as one-time UN envoy and clean power advocate undermined by energy shift