Are there DC motors that can apply constant torque under extended stalled or reversed conditions?
A motor that can provide torque continuously or for an extended period of time while stalled is, by definition, a torque motor. Torque motor designs can be implemented using various types of motors, both AC and DC. The design could result in a motor that is physically larger than a continuously rotating motor with the same torque capability. The design could include a separately powered cooling fan and other cooling enhancements.

If the motor needs to prevent the load from possible movement in either direction, speed and direction sensing would be required.

A servo motor and control system may be required, depending on the overall requirements. Servo motors can be provide performance similar to torque motors in addition to position control. Various types of AC and DC motors can be designed as servo motors.

To determine what is the best option, you need to consider every aspect of the requirement including detailed duty cycle, environment, speed range, accuracy requirements, actual torque and speed requirements, number of units required, available budget, expected useful life of the equipment, reliability requirements and probably other factors.