At last week's Daily Journal Annual Meeting, Charlie Munger had this to say about great investment opportunities:

You don't get very many. It isn't like that kind of opportunity comes along every day. The trick in life is when you get the one, or two, or three that your fair allotment for a life is that you've got to do something about it.

I bring this to your attention today because Union Pacific (NYSE:UNP) could be such an opportunity. Like many railroads, Union Pacific has been squeezed by the downward trend in coal demand. High levels of utility stockpiles and lack of international demand have cut back on demand and added to the downward pressure of pricing. It's difficult to envision a real return to coal demand with regulatory overhang, lower natural gas prices, and a strong dollar. As a result, share prices are down 35% from the highs of early 2015.

UNP Chart

UNP data by YCharts

However, I expect intermodal and merchandise revenue to more than offset any declines in coal as it becomes less and less of the company's revenue model. Should this thesis play out, it would be just one of the many reasons Union Pacific is a buy right now. Let's take a look.

Leading railroad network in the U.S.
Union Pacific is one of the largest U.S. railroads. Its route lines cover the western two-thirds of the U.S., and it operates critical corridors that connect U.S. and Mexican gateways, with 31,974 route miles that connect 23 states west of the Mississippi River. The company has a diversified revenue stream: Intermodal (20%), Industrial Products (19%), Chemicals (17%), Agricultural Products (17%), Coal (16%), and Automotive (11%).

Source: Union Pacific company presentation.

Capital-intensive business that creates high barriers to entry
Union Pacific also has the advantage of essentially operating as part of a government-protected duopoly west of the Mississippi -- the only other major competitor is Burlington Northern. The high barriers to entry make the company's assets and systems almost impossible to replicate and provide for limited competition. Historically, like many of the other railroads, the company has proved it has pricing power greater than inflation. That pricing power should allow it to take advantage of future growth in underperforming industries -- such as energy, agriculture, construction, and housing -- and generate excess returns over time.

Source: Union Pacific company presentation.

A key metric for railroads is the operating ratio, which is a primary measure of profitability, expressing a company's operating expenses as a percentage of revenue -- the inverse of operating margins. Union Pacific was able to drop its operating ratio to 63.1% in 2015, its best year ever. Management continues to focus on this number, with a goal of hitting 60% by 2019. The lower the operating ratio, the more efficient the company. Union Pacific consistently has one of the best operating ratios in the industry.

A shareholder-friendly and competent management team
Management overall is known as one of the best in the industry. It's very focused on the current environment and acknowledges the lack of demand in various sectors. As a result, it's put locomotives into storage and cut back on hiring to balance out operations.

Management has been extremely shareholder-friendly, having returned almost $14 billion to shareholders in the form of dividends and share repurchases since 2013. The company still has another 59 million shares to repurchase under its current authorization  (7% of overall shares outstanding). Overall, management has repurchased 15% of the shares outstanding over the past five years. Also, management has been able to generate returns on capital in the mid- to high teens since 2010, which shows its ability to allocate capital effectively.

Source: Union Pacific company presentation.

In addition, management has increased the dividend from $0.97 to $2.20 per share over the past five years and has repurchased stock at reasonable prices. I expect management to continue to be shareholder-friendly.

Reasonably priced shares
As Warren Buffett once said, "It's far better to buy a wonderful company at a fair price than a fair company at a wonderful price." In the case of Union Pacific, I couldn't agree more.

Management has guided for roughly $3.75 billion in capex and expenses in 2016 for its capital plan. The three-year average of cash flow from operations is $7.18 billion. That gives us a back-of-the-envelope calculation of $3.43 billion in free cash for  2016, which would have shares trading at a P/FCF of 19.73 at current levels, based on the current market cap of $67.72 billion (enterprise value of $79.96 billion). At a free cash flow yield of more than 5%, it's certainly not going to blow your socks off. However, when you include the 2.75% dividend, the return potential starts to get interesting.

UNP Operating Margin (TTM) Chart

UNP Operating Margin (TTM) data by YCharts

Also, on a price-to-free cash flow basis, the company is trading well below that of its peers. I find this interesting given the company's operating history and higher-quality nature versus that of its peers. Union Pacific has continuously generated better operating margins versus many in the peer group. For such a high-quality business, shares appear to be reasonably valued at current levels.

Investor takeaway
With its P/E at 13.80, you're paying below a market multiple for a business that has true competitive advantages. In addition, the FCF yield is over 5%, the EV/EBIT ratio is 9.11, and the dividend yield is 2.75%. The company won't make you rich overnight, but high barriers to entry, limited competition, and increased efficiencies all bode well for the future.

It's not every day you find businesses with great moats like Union Pacific trading at a reasonable valuation. Its industry-leading margins and competitive advantages will give it a unique opportunity to compound capital for years to come. Union Pacific looks attractive at current levels, especially for Foolish investors with the ability to look past current business weakness.

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.