Brazil finished first in Group B and will play Paraguay in the next round. Ecuador was eliminated.
Pato scored with a header in the 28th minute and a close-range shot in the 60th, while Neymar netted from inside the area in the 48th and 76th.
Striker Felipe Caicedo scored for Ecuador in the 37th and 58th.
The result was still good enough to get Paraguay through to the quarterfinals from Group B, eliminating Costa Rica from the South American competition. Venezuela had already advanced.