The global shipping downturn has been a margin drag for most operators in the sector, but UPS, when it reports quarterly results on Tuesday, will offer insight into how it has sheltered profits and whether it can find new business to offset any pain.

Shares in UPS are down roughly 20% so far this year, versus the 40% decline in FedEx stock. Last month, FedEx pulled its full-year guidance, blaming a steep drop in global demand.

"They're better business people, they execute better, (and) they're consistently, significantly more profitable than FedEx," Dean Maciuba, a former FedEx sales executive turned industry advisor, said of UPS.

UPS seems to have done a better job spotting and responding to the slowdown that hammered FedEx, which had too many planes in the air and trucks on the road, analysts and investors said.

They pointed to Atlanta-based UPS keeping its financial outlook for the year unchanged even though FedEx's warning gave them cover to make a change.

At the same time, the UPS sales team has been working to drum up new business. One recent win came at the expense of FedEx, according to two people familiar with the matter.

Lego, the $7.3 billion Danish maker of colorful plastic bricks used to build everything from UPS delivery trucks to Hogwarts Castle of Harry Potter fame, switched from FedEx to UPS, according to the sources, who asked not to be identified.

None of the companies involved would comment on the deal. FedEx said it is not unusual for customers to move from carrier to carrier based on specific needs.

UPS is on track to report in-line third-quarter earnings, supported by stable domestic volumes and cost controls, UBS analysts said in a recent note.

Still, there are significant challenges ahead.

Global air and ocean import cargo volumes, a gauge of demand for logistics companies like UPS and FedEx, are slumping.

Customer response to Amazon.com's pre-holiday sale this month was tepid - suggesting muted delivery demand from UPS's largest customer as inflation and recession worries temper expectations for the year-end festive season.

And analysts have downbeat expectations for the U.S. economy next year, when the contract between UPS and its unionized drivers and package handlers expires - exposing the company to the risk of a work stoppage and higher employee costs.

(Reporting by Lisa Baertlein in Los Angeles and Shivansh Tiwary in Bengaluru; Editing by Ben Klayman and Nick Zieminski)

By Lisa Baertlein and Shivansh Tiwary