How to split table records into aggregate and array in PostgreSQL
The first part is pretty easy:

select values,count(*) from max_values group by values order by 2 desc limit 1


The second part you could the ARRAY function to transform rows for all values that aren't equal to the one above into one long array, though that is honestly a little tough to do in one SQL statement. Does it really have to be one long array like that? What are you going to do with it?  There is an example of ARRAY() here:

https://blog.lerner.co.il/turning-postgresql-rows-arrays-array/