Hello Petr,
you should not assign values to the variables. Instead keep the variable name and the associated value in a (sub-)list:
In[1]:= m = {{a, 5}, {b, 6}, {c, 6}, {d, 2}}
Out[1]= {{a, 5}, {b, 6}, {c, 6}, {d, 2}}
Next you sort the sublists according to the 2nd list member which holds the value:
In[2]:= t1 = Sort[m, #1[[2]] > #2[[2]] &]
Out[2]= {{c, 6}, {b, 6}, {a, 5}, {d, 2}}
Finally you split the list t1 into sublists which identical values and since they are already ordered according to the size of the value, you take the first member:
In[3]:= First[SplitBy[t1, #[[2]] &]]
Out[3]= {{c, 6}, {b, 6}}
If your dataset is very large it may be more efficient to search for the max value without sorting the values.