The EU agrees what it calls “the world’s most ambitious” deal to cut greenhouse gas emissions by 40% by 2030, overcoming deep divisions among members.