It seems that a clearer differentiation between climb rate and climb angle would be helpful, and we can add climb gradient (height gained per unit of distance) as it is what we really want to maximize when obstacle clearance is a concern.
As dmspilot stated, the relationship between thrust and drag affects rate of climb. In order to understand the effect on angle of climb, it is necessary to take groundspeed into account. Flaps-up Vx is faster than Vx for flaps extended. Using the configuration-appropriate Vx, a climb with the flaps extended will result in a decrease in climb rate, but also a decrease in groundspeed, and those effects on climb angle tend to offset. If Vx is significantly lowered due to flap extension, then climb angle may be improved by the use of flaps. Even if climb angle were equal or slightly less using flaps, the shorter ground run may result in better obstacle clearance performance, as mauleskinner pointed out. In any case, if the objective is to clear an obstacle, maximizing climb gradient is what matters regardless of obstacle height and distance from the takeoff point, and best climb gradient directly coincides with best climb angle.
But the above is merely academic. With specific regard to the OP, examining the manufacturer’s published takeoff recommendations for a single aircraft type (C172) as this thread has done reveals that merely making a design alteration to an aircraft type can produce a meaningful difference in the configuration and speed under which optimum takeoff performance is achieved. It therefore seems ill-advised to over-generalize or make absolute statements because there are just too many variables that come into play when comparing different aircraft types, and even different models of a single type. A good working knowledge of basic aerodynamics is important, but most important is, as nauga succinctly advised, “know your airplane, fly your airplane.”