First order by importance then group by section
i used this query

SELECT t.id, t.section, t.rev, t.importance FROM (
   SELECT docs.id, docs.section, docs.rev, (SELECT SUM(docs_importance.importance) FROM docs_importance WHERE docs_importance.doc_id = docs.id) AS importance
   FROM docs
   GROUP BY docs.id
   ORDER BY importance DESC
) AS t
GROUP BY t.section


where i first made a subquery as a temporary table then ordered it by importance then grouped the outer query by section to get the final result.