Your signature does not tell what vehicle you are towing with and the picture is too small to tell also. I went to your profile and see that your tow vehicle is a 2014 Silverado 1500 5.3L 8 cyl.
I don't think what you experienced is anything unusual or that it will hurt the engine at all. I wouldn't worry about running at those RPM's for the short time it takes to get up a mountain or hill. I'm not even sure it would hurt it to run those RPM's for an extended time.
Barney
2004 Sunnybrook Titan 30FKS TT
Hensley "Arrow" 1400# hitch (Sold)
Not towing now.
Former tow vehicles were 2016 Ram 2500 CTD, 2002 Ford F250, 7.3 PSD, 1997 Ram 2500 5.9 gas engine