Under the treaty, the German Empire would gain Ukraine, the breadbasket of Europe, along with coal and other resources. Wouldn’t this have negated the Western Allies’ blockade and allowed Germany to fight on longer?
No. By the second half of 1918 Germany was done. In June of 1918 the German frontline strenght was approximately 1,6 million men, by November it was less than 900 000. The entire central powers were collapsing and collapsing fast. The Austro-Hungarians were spent. The Balkans-route was closed and with it virtually all of Germany's oil imports and a significant amount of her food imports. The German national stockpiles were all but depleated, the industry could no longer keep up with wartime demands and the nation was on the brink of revolution.
From a military standpoint, the allies were simply overpowering them, using their numerical superiority to launch new attacks on new sections of the front faster than Germany could reposition and reinforce the sections. They were also no longer making the mistake of the previous years in trying to force an attack after the reinforcements had arrived. Instead, they settled for more limited objectives and gains and shifted their attention to a new attack in a different sector, forcing Germany to shift reinforcements again and again. With an increasing numerical and material superiority this strategy quickly exhausted the Germans.
By november of 1918 what began as a sailor's revolt a month before had become a full blown revolution, the army was on the brink of total mutiny the public support for a continued war had completely evaporated. The Italians had defeated the Austro-Hungarians in the south, the Ottomans had capitulated, the Bulgarians had signed an armistice. Germany stood alone, weakend, without public support, with the navy in revolt and the army balacing on the brink of mutiny, with all stockpiles exhausted and the economy in shambles.
It was never a question of continued fighting or armistice, it was a question of the complete and total collapse of Germany or arimistice. The limited gains made at the treaty of Brest-Litovsk could in no way, shape or form offset the fact that the central powers had dissolved and Germany was on the brink of collapse.
Apart from what was said above about the Western Front, it should also be noted that Germany did not (and could not) benefit from Ukrainian resources in a manner that could substantially change its situation. The war is not a computer game, so Ukraine did not automatically give Germany "+100 bread, +50 coal" - those resources had first to be collected over a large territory and then transported to Germany. At the same time, the Ukrainian peasants were naturally not especially willing to support the German war effort in exchange for basically nothing and in many cases fought back - with weapons they still had after the collapse of the Russian Imperial Army. A very artistic, but generally correct description of this situation can be found in the novel "The White Guard" by the famous Russian writer Mikhail Bulgakov.
As a result, Germany could not free as many troops for the Western Front as they hoped, because they still had to keep them in the Ukraine in order to secure the resources - of which, given the aforementioned factors, they could get much less than they actually needed. In short, even though Germany did gain something from Brest-Litovsk, it was by no means sufficient to negate the Allied advantage.