The changing pattern of climate variables has caused extreme weather events and severe disasters especially in mountainous regions. Such events have a detrimental impact on resources, environment and society. Thus, it has become imperative to examine trends and forecast of meteorological variables using scientific modeling approach at micro level. This study makes an attempt to examine trend in temperature and rainfall using Modified Mann–Kendall test and Sen’s slope estimator during 1980–2021. A Bagging-REPTree machine learning model was utilized for forecasting temperature and rainfall trend for the next 20 years (2022–2041) to understand the temporal dynamics in Shimla district of Indian Himalayan state. Correlation coefficient (R), mean squared error (MSE), mean absolute error (MAE), and root mean squared error mean (RMSE) performance were determined to assess effectiveness and precision of the model. The findings revealed that the frequency of intense rainfall in the district has increased, especially during the monsoon season (June–September) during 1980–2021. Annual maximum, minimum, and mean temperatures have exhibited significant variability while annual rainfall has shown a decreasing trend. The forecast analysis revealed significant trend for rainfall during monsoon season and increasing trend in the maximum temperature has been observed during summer and winter seasons. The analysis has provided sufficient evidence of variability and uncertainty in the behavior of meteorological variables. The outcome of the study may help in devising suitable adaptation and mitigation strategies to combat the effect of climate change in the hilly regions. The methodology adopted in the study may help in future progression of the research in different geographical regions of Western Himalayas.