The relative outperformance of Caterpillar (NYSE:CAT) and Joy Global (NYSE:JOY) in 2014 could easily lead Fools to conclude that the mining sector is making a comeback after a couple of years in the doldrums. Is this the case, or are their stock-specific reasons why these two companies have outperformed?

Caterpillar and Joy Global outperform
Going into 2014, the financial markets were fretting about the potential for emerging market weakness. Not only had a slew of companies reported growth that was less than expected in the BRICs, but fears over the shadow banking system in China, and subsequent defaults, have been at the forefront of concerns. It's usually true to say that if emerging markets catch a cold, then mining and commodities will start sneezing. Moreover, China's torrid pace of capital investment was bound to slow at some time, taking demand for certain hard commodities down with it.

These fears get expressed in the stock prices of mining capital-machinery companies, like Caterpillar and Joy Global. If conditions turn out to be not as bad as expected, then the stocks can see some upside, thanks to value hunters and "relief-rally" buyers coming in.

Indeed, the charts seem to suggest that this is exactly what happened, as  these companies have outperformed in 2014.

JOY Chart

JOY data by YCharts

Moreover, there has been some positive news on U.S. coal production (a key commodity for mining machinery demand) this year, with Joy Global's CEO, Edward Doheny, outlining the following on the March conference call:

For the first time in two years, we are seeing some incremental positive signs coming from the U.S. coal market. While production fell below 1 billion tonnes in 2013 for the first time in 20 years, U.S. coal production is expected to rebound by 35 million to 45 million tonnes this year.

Indeed, there has been a small pickup in U.S. coal production and coal rail traffic this year.

US Coal Production Chart

U.S. Coal Production data by YCharts

Is it time to get optimistic on mining?

Why Caterpillar and Joy Global outperformed
Actually, the indications are that mining conditions have gotten worse! Joy Global's recent results suggested that mining-machinery demand was still weak. Its original equipment orders were down nearly 43%, and the main focus of its growth strategy was to try and increase service orders. In other words, the company's strategy was to increase the share of its own equipment that it services with consumables. This is not a strategy suggesting strong end demand for capital machinery. Fools can read more on Joy Global linked here

Turning to Caterpillar, its recent results were well received by the market for three reasons -- none of which included any strength in mining.

First, although, the company increased its full-year EPS outlook by $0.25, from $5.85 to $6.10, its sales outlook remained unchanged. In fact, the forecast for full-year resource industry sales was lowered to a negative 20% from a previous forecast of a 10% reduction -- not a good indicator for the mining industry. The real strength came from its construction segment, which saw its sales forecast increased to 10% growth from a previous forecast of a 5% increase. Energy & Transportation revenue is also expected to increase by 5% in 2014.

Second, Caterpillar's construction sales are benefiting from an inventory rebuild (whereby dealers are purchasing equipment again, having run them down in a weak selling season in 2013) and, interestingly, from increased end-user demand. So, the real strength in Caterpillar's earnings comes from its construction segment.

Third, the profit improvement in the first quarter largely came from reduced manufacturing costs (lower by $230 million). In addition, selling, general and administrative costs were lower by $98 million, and research & development costs decreased by $54 million. To put these cost reductions into context, Caterpillar's operating profit increase was only $180 million in the quarter.

The bottom line
Although, there are some positive indicators for the mining industry, mainly from increased U.S. coal production, the backdrop remains unfavorable. Caterpillar's improved performance is largely due to stock specific reasons and an improvement in its construction segment. While, Joy Global's growth prospects are not focused on end-demand improvements. Also, a combination of geo-political risk and emerging market uncertainty continues to overhang the industry. It's not time to get too excited about the mining sector in 2014.

If anything, it's getting worse.