Any chance for a few photos...layout, track condition, loco, cars, et al?? Or, a short video of running the loop showing the slow points?
You know..."A picture's worth ...."?!
------------
Good suggestions in the above responses.
You might also check how free-rolling the cars (and loco tender, dummy diesel units, if any) are. Until we know more about the train itself, using O31 track leads one to assume postwar equipment. Without thorough cleaning (e.g.,pet hair, old gunky residues on bearing surfaces, caked on gunk on wheel treads, rust, etc., etc..) and proper re-lubing they eventually can become quite a load on the poor loco. And, ditto re maintenance of the loco.
Want to do a subjective check? Fasten a few straight pieces of track to a piece of 1x board. Place a car on one end of the track. Slowly lift the end of the board to induce the car to free roll. How high did you have to lift the board to get it to roll? Same amount all cars? Pick a car, thoroughly clean the wheels and bearing surfaces, re-lube, re-check the free roll. Better?
Then, re cleaning the inside of the track rails...especially the inside surfaces of the outer two rails on curved track. When a train is rolling on straight track, the wheel-to-track load is minimized. The flanges help keep the train centered between the rails. But, when the toy train encounters a curve...the sharp O31 and O27 curves, especially...those large flanges have more of a 'scrubbing' contact with the inner surfaces of the curved rails. This scrubbing action is not unlike the function of a brake, designed to slow down a rotating wheel. Of course, the flanges are necessary to keep the train on the track.
So all of that adds to the load on the engine. IOW, slow-downs on the curves for these toy trains are somewhat to be expected even with the best of all other conditions...IMHO, of course.
And, yes...as Ted 'sed': "If you solve the issue, please post back and let us know the cause."
KD