Accurate emulator for the redshift-space power spectrum of dark matter halos and its application to galaxy power spectrum