Perez, Hosmer star in Royals’ victory over Rangers