The query without grouping gives such a result. Left right id number.
If you group BY GROUP id the number of hits the maximum in the result. Sort before grouping don't know how because the ORDER BY should come after GROUP BY, and it already receives the minimum values and singular.
SELECT table1.id, table2.members
INNER JOIN table2 ON table2.id = table1.id WHERE table2.members > 400 GROUP BY id
The desired entry with the maximum value among members but only those records where the members > 400