gdal_translate has a parameter to resample the values based on the most frequent class in the output pixel (-r mode). However, this most frequent class does not necessary exist (when two or more of the most frequent classes have exactly the same number of pixels.
Does anyone know what happens to the output pixel value when two classes with the most pixels are exactly the same ? Does it take the first discovered value, the last one, the smallest one, the larger one, a random one or any other rule? At least it seems to select a value.