Understanding defect-mediated cubic to hexagonal topotactic phase evolution in SrMnO3 thin films and associated magnetic and electronic properties