England, who had already qualified for the last 16 with a game to spare, ended the group stage with five points but managed only two goals in three games.
Endrick, who will move from Palmeiras to Madrid at the end of the season when he turns 18, struck nine minutes after coming on as a second half substitute.