* TSX up 51.80 points, or 0.38 percent, at 13,628.97 * Annual gain much smaller than U.S. indices By Alastair Sharp TORONTO, Dec 31 (Reuters) - Canada's main stock index rose on Tuesday, boosted by gains among a broad swath of companies including banks, railways and energy companies, as investors looked optimistically ahead to 2014. The Toronto Stock Exchange's S&P/TSX composite index is on track for a gain of more than 9 percent in 2013, a far smaller gain that those notched by the three main U.S. indices. It was up 51.80 points, or 0.38 percent, at 13,628.97 points by mid-morning, on the back of modest gains in all but two of the index's ten main sectors. Resource stocks, which make up a large chunk of the overall index, had the biggest positive impact, with Canadian Natural Resources Ltd up 1 percent at C$35.95. Gold miners reversed losses from Monday, with Goldcorp Inc up 2.8 percent at C$22.87 and Barrick Gold Corp gaining 2.2 percent to C$18.61. Producers of the precious metal have been hard-hit this year as the price of bullion has plummeted. While a seemingly surer footing for the global economy has many investors confident that Canada's resource stocks will lift their game in the next year, some are still ringing a note of caution. "I don't share everybody's enthusiasm for the markets. They are trading at rarefied levels," said John Ing, president of Maison Placements Canada, referring to U.S. markets overall and specific sectors of the Canadian market such as banks. He said interest rates on 10-year government bonds should rise further, as the U.S. Federal Reserve withdraws stimulus that has supported equities for several years. One sector that could gain would be gold, he said. "The byproduct of higher interest rates will be volatility in the market and a return to risk assets, and that's where gold does well."