Primero tienes que obtener el salario máximo para cada departamento:
SELECT department, max(salary) as max_salary
FROM test
GROUP BY department
luego puede volver a unir esta subconsulta a la tabla de prueba:
SELECT t.*
FROM
test t INNER JOIN (
SELECT department, max(salary) as max_salary
FROM test
GROUP BY department
) d ON t.department=d.department AND t.salary=d.max_salary