The two countries — which have refused to make similar deals before — were pushing for a breakthrough on the sidelines of the U.N. General Assembly.