Effects of AGN feedback on galaxy downsizing in different environments