Embedded stellar populations towards young massive star formation regions - I. G305.2+0.2