Hearts had been on course to win the league for the first time since 1960 and end 41 years of Celtic and Rangers dominance.