The shear failure behaviors of U71Mn rail steel are investigated by quasi-static and dynamic compression tests utilizing two different hat-shaped specimens: S1 which combines shear and compressive stress states and S2 which combines shear and tensile stress states. A split Hopkinson pressure bar is used to acquire shear stress–strain curves at various initial temperatures and shear strain rates, and it is found that a lower shear strain rate is observed in hat-shaped specimen S1 than that in hat-shaped specimen S2 under the same impact pressure. Scanning electron microscopy is employed for observing the microstructures of specimens. The results indicate that the hat-shaped specimen S1 is difficult to form voids and dimples. Moreover, as far as the hat-shaped specimen S2 is concerned, the number of voids reduces with the rising shear strain rate, and no voids appear on the fracture surface at the shear strain rate of 36,000 s−1. Furthermore, the creation of voids is aided by a rise in initial temperature. The factors affecting the formation of adiabatic shear bands are explored based on the numerical simulation, which suggests that the magnitude of the temperature gradient plays a crucial role in the generation of adiabatic shear bands.