For decades fossil fuel majors tried to fight the consensus – just as big tobacco once disputed that smoking kills