Bernardo Silva scored twice as Manchester City beat Bayern Munich 3-2 in an entertaining International Champions Cup match in Miami.