To understand these lines, it is useful to also look at the poem's opening. I do not have a copy of The Complete Kobzar, so I will be using the version from The Poetical Works of Taras Shevchenko: The Kobzar, available from the Internet Archive, and so the translations may differ slightly.
The opening lines are:
There was a time in our Ukraine
When cannon roared with glee
A time when Zaporozhian men
Excelled in mastery!
They lived as masters - freedom’s joy
And glory were their gain
Here Shevchenko is harking back to an idealised vision of Ukraine, before it was amalgamated into the Russian Empire. It was peopled by the Zaporozhian cossacks who led free and warlike lives. This cultural reference to Ukraine's romantic cossack past is common to many of Shevchenko's poems. John Panchuk, for example, remarked in Shevchenko's Testament that:
For Shevchenko, Ukraine is the home of the Zaporozhian Kozaks, whose
valor and exploits in countless struggles were the bulwark for over
two centuries of individual and political freedom of the people, whose
glory and fame were preserved in songs and ballads of the wandering
minstrels, the kobzars of Ukraine.
The subject of the poem, Ivan Pidkova, was a prominent leader of the Ukrainian cossacks, fighting against domination by the Ottoman empire, possibly even leading a raid on Constantinople itself. This "happy time" of martial prowess ended, however, and Shevchenko continues:
All that has passed, and what is left
Is grave mounds on the plain
The "grave mounds" refer to the burial mounds where many of the cossacks were buried, and with them, symbolically, Ukrainian freedom. For that reason Shevchenko regarded them as sacred, and was appalled by the archeological expeditions that despoiled them (see for example his poem "The Great Mound" from 1845).
The lines quoted in the question echo the opening lines:
There was a time when in Ukraine
Even distress would dance
And sorrow in a tavern drank
In honeyed brandy’s dance
In that happy past time, even the unpleasant aspects of life, distress and sorrow, were better than the way they appear in Shevchecnko's time. Although they are undesirable, they are nonetheless tolerable because they are being experienced by free people.
The verse ends with the lines:
There was a time when life was good
In that Ukraine of ours...
Recall it then - perhaps the heart
May briefly bathe in flowers
which again calls to the reader to remember the golden era of Ukraine's past, and hold on to the hope that those days may come again.