Russia and Ukraine reached a deal aimed at releasing millions of tons of grain from Ukraine’s Black Sea ports that, if implemented, would mark a major step toward shoring up global food supplies.