St Johnstone maintain their dominance over Hearts with a fourth win in five games against the capital side this season.