The Hungarian army is very small and I doubt they would even be able to occupy any land in Ukraine. Keep in mind that if we assume that Ukraine collapses that would mean a lot of well armed militias are running around there.And if Ukraine collapses and Poland goes through with their western occupation rumours, then I have a strong bet Hungary will try and snatch the mountains back, it is rightful Magyar clay after all
And that's not even talking about the big political issues with doing that.