Having to choose between heavyweight stocks such as Caterpillar (NYSE:CAT) and ABB (NYSE:ABB) isn't an easy task. Both companies are global leaders in their respective industries, are worth more than $50 billion each in terms of market capitalization today, and are firing on all cylinders. ABB shares are up 17% year to date and just hit their 52-week high, while Caterpillar is still up about 9% so far, even after retreating from its recent 52-week high.

Buying a stock at or near its 52-week high might seem counterintuitive, but with Caterpillar on the cusp of a recovery from a prolonged slump, and ABB pulling out all stops to grow, there couldn't be a better time for investors to consider owning these stocks. The question is: Should you buy Caterpillar or ABB today?

What's fueling Caterpillar investors' optimism?

Both Caterpillar and ABB are into cyclical businesses, but its huge exposure to commodity-centric mining and oil and gas sectors made it a lot harder for Caterpillar to grow in recent years. Things started rolling last year, after commodities such as iron ore bottomed out and Donald Trump was elected president, fueling hopes that a potential infrastructure spending stimulus could revive the world's largest construction-equipment manufacturer's fortunes.

Sparks fly from a cutting tool in a manufacturing facility.

Image source: Getty Images.

Caterpillar shares took off after the presidential elections, and bulls found the perfect excuse in the company's Q1 earnings beat last month April to drive the stock to a 52-week high even after Caterpillar rolled back its full-year EPS guidance to $2.10 from $2.30 at the midpoint. What investors didn't overlook, though, is that even with its lower guidance, Caterpillar should end the year on a better note than it did in fiscal 2016, when it incurred a GAAP loss of $0.11 per share. Caterpillar also upgraded its full-year revenue guidance by 5% at the midpoint to $39.5 billion, encouraged by strong aftermarket sales in its resource industries (mining) and energy and transportation segments.

Not surprisingly, investors who've waited years to see Caterpillar's fortunes turn have grown optimistic: The stock's up almost 7% since the Q1 earnings release on April 25.

What's driving ABB stock higher?

ABB's journey hasn't been as lumpy as Caterpillar's, thanks largely to its electrical equipment and power transmission businesses that are more on the defensive side and help offset the swing in commodity-linked end markets. ABB is, in fact, a hugely diversified company that operates four somewhat-unrelated business segments, serving several key industries.

Chart showing ABB's segment-wise Q1 revenues.

Data source: ABB financials. Chart by author.

Much like Caterpillar, ABB reported 3% higher revenue during its first quarter, but unlike Caterpillar, ABB's net income jumped 45% year over year, driven by one-time gains on the divestment of its cables business. ABB's operating earnings were otherwise flat at $0.28 per share, which is also noteworthy, as the company is facing some headwinds, especially those related to Brexit. ABB, headquartered in Zurich, got nearly 34% of its orders from Europe last year.

ABB's Q1 book-to-bill ratio of 1.07 is particularly encouraging, as it reflects a strong flow of orders. ABB is rapidly gaining traction in robotics and automation and is all set to make a big leap with the acquisition of Austria-based Bernecker + Rainer (B&R), a specialist in machine and factory automation products and solutions. As it turns out, investors in ABB have valid several reasons to be optimistic and continue to bid the stock higher. ABB is now up almost 12% since its Q1 earnings release on April 20.

What's next for Caterpillar and ABB?

By now, it's clear that Caterpillar's line of business is more prone to macroeconomic swings than ABB's is. For Caterpillar to get back on the growth track, it's imperative for mining and oil and gas companies to revive their capital projects. That, however, depends on commodity prices, which remain unpredictable. Iron ore and copper, for instance, are already retreating after a heady start to the year, and oil prices aren't showing any signs of stabilizing yet. Neither is there any sign of an infrastructure plan from Trump yet. Caterpillar itself doesn't expect to see any material benefits from such spending until at least next year.

Caterpillar is doing all it can to cut costs and maintain margin, but despite all its efforts, fiscal 2017 will go down in Caterpillar's history as one of its worst years ever in terms of profit. Combine that with the challenging conditions in its end markets, and I can't really come up with a strong investment thesis for Caterpillar right now, especially after the stock's recent rally.

A solar-panel array, with wind turbines in the background against a blue sky.

ABB's technology is powering up big solar energy projects across the world. Image source: Getty Images

ABB, on the other hand, is in a growth phase, more so as it taps high-potential markets such as China and India. Both nations are increasingly spending on energy infrastructure, which could open up huge opportunities for ABB. Just to give you an idea about ABB's capabilities, it recently powered and automated the world's largest solar project in India.

Utilities and renewable energy, however, make up just one of ABB's growth catalysts. Automation and the Internet of Things are other megatrends ABB is poised to exploit. From industrial robots to smart sensors for remote control to fast-charging systems for electric vehicles and smart-home solutions, ABB is pervading all spheres of life with its advanced and automated products.

Given how closely Caterpillar's fortunes are tied to the commodity markets, it's not surprising that management hasn't outlined financial goals. ABB, on the other hand, has a vision in place, striving to achieve the targets through 2020 that it set out in 2015, with 2014 as the base year.

MetricTargetStatus As of Dec. 31, 2016
Revenue growth 3%-6%              0%
Operational EBITA % 11%-16% 12.4%
Operations EPS CAGR 10%-15% 4%
Net income-to-free cash flow
>90% 161%
Cumulative return on investment % Mid-teens              14.1%

Data source: ABB financials.

Add it all up, and ABB appears to be a better investment option than Caterpillar for investors right now.

10 stocks we like better than Caterpillar
When investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.*

David and Tom just revealed what they believe are the 10 best stocks for investors to buy right now... and Caterpillar wasn't one of them! That's right -- they think these 10 stocks are even better buys.

Click here to learn about these picks!

*Stock Advisor returns as of May 1, 2017

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.