Detroit snapped an eight-game losing streak, beating Cleveland to move back into a tie with the Guardians atop the American League Central with three games to play.