Indian stock markets gained for the second consecutive day on Tuesday, led by a surge in energy and auto stocks, amid the logjam in Parliament over the GST Bill and hours before the US Fed meets on Tuesday to decide on what experts view as an imminent interest rate hike, the first since 2006.

The S&P BSE Sensex closed at 25,320.44, up 170 points, or 0.68%, while the NSE Nifty ended with a gain of 50.85 points, or 0.66%, at 7,700.90.

ONGC, Reliance Industries and Cairn India gained between 2.10 and 2.30% on the NSE, tracking a likely rise in crude oil prices that would translate into higher crude refining margins for these companies.

Auto stocks also gained, with Eicher Motors (2.79%), Maruti Suzuki (1.11%), Bajaj Auto (1.07%), Ashok Leyland (1.51%) and Hero MotoCorp (1.04%) on the BSE.

The advance-decline ratio was skewed in favour of advances, with 18 registering with gains on the BSE. On the NSE, 32 shares advanced while 16 declined on Tuesday.

Stocks that ended in the red included Wipro, Coal India, Tech Mahindra, Punjab National Bank, ICICI Bank and Adani Ports.

Tech Mahindra and Mahindra & Mahindra (M&M) ended with mixed results on the exchanges on Tuesday reacting to the news of the companies announcing that they would buy a controlling stake in Pininfarina S.p.A., an Italian brand in automotive and industrial design.

Pininfarina is an automotive design and engineering services company providing services to global automotive OEMs. Pininfarina's revenues were 86.60 million euros for the year ended 31 December, 2014. Tech Mahindra and M&M shall purchase 76.06% of Pininfarina shares from the current controlling shareholder Pincar S.r.l. at 1.1 euro per share.

Tech Mahindra lost 4.18% to close at Rs 520, while M&M rose 0.16% and ended at Rs 1,289.05 on the BSE.

Meanwhile, US stock markets are gearing up for a 25 basis point hike on Wednesday.

"As the committee contemplates the first rate increase since 2006, policymakers — particularly Chair (Janet) Yellen â€” will be struggling at the December meeting to convince colleagues in one direction or the other, reigning in hawkish expectations for more aggressive action while convincing the more dovish skeptics that a rate increase is appropriate regardless of the current restrained pace of economic expansion," Lindsey M. Piegza, chief economist at Stifel Fixed Income, said in a note to clients, reports CNBC.

Crude oil prices were up on Tuesday due to record low prices prompting investors to buy. Brent crude was up 60 cents and trading at $38.52 per barrel, after touching an intra-day high of $38.95.

"It's technical buying. It's pretty obvious shorts started to take profit when Brent prices dropped down to the 2008 low," said Tamas Varga, oil analyst at London-based PVM Associates.