Rangers struck first at Tynecastle as Dujon Sterling's deflected goal put them into an early lead against Hearts.