Not necessarily any hardwood. Red Alder for instance, while useful for interior work, (I use it a lot) will rot out in one foggy night. Cottonwood or Poplar not only rots quickly but is highly subject to mechanical damage. In fact there is almost no hardwood available in the far west that is suitable for cross ties, at least in sufficient quantities. The prefered wood seems to be coastal Douglas Fir.
The sawmill in Baker City cut Ponderosa Pine ties until it closed in the mid 1990's. The word was that P. Pine, while softer, would absorb treatment better than some other woods and would last about as long in service. The old Sumpter Valley Ry. cut and treated their own ties from P. Pine, and some of these are still fairly sound 60 years after the line was abandoned. These ties were cut green however, and it is true that P. Pine deteriorates quickly once dead and not treated. In the Forest Service a P. Pine log that was left in a cold deck for over 60 days was considered a cull.
For what it's worth, Lodgepole Pine was cut for ties by hand into the 1940's. A camp in Wyoming cut these during the winter while the sap was down, the work being done with a broad axe, falling axe and bow saw. We have some of these (relays) in use on the Sumpter Valley.