World Cup hosts Brazil set up a meeting with Chile in the round of 16 as a 4-1 victory over Cameroon secured top spot in Group A.