A Herschel study of YSO evolutionary stages and formation timelines in two fields of the Hi-GAL survey