Energy system modeling and analysis can provide comprehensive guidelines to integrate renewable energy sources into the energy system. Modeling renewable energy potential, such as wind energy, typically involves the use of wind speed time series in the modeling process. One of the most widely utilized datasets in this regard is ERA5, which provides global meteorological information. Despite its broad coverage, the coarse spatial resolution of ERA5 data presents challenges in examining local-scale effects on energy systems, such as battery storage for small-scale wind farms or community energy systems. In this study, we introduce a robust statistical downscaling approach that utilizes a machine learning approach to improve the resolution of ERA5 wind speed data from around 31 km x 31 km to 1 km x 1 km. To ensure optimal results, a comprehensive preprocessing step is performed to classify regions into three classes based on the quality of ERA5 wind speed estimates. Subsequently, a regression method is applied to each class to downscale the ERA5 wind speed time series by considering the relationship between ERA5 data, observations from weather stations, and topographic metrics. Our results indicate that this approach significantly improves the performance of ERA5 wind speed data in complex terrain. To ensure the effectiveness and robustness of our model, we also perform thorough evaluations by comparing our results with the reference dataset COSMO-REA6 and validating with independent datasets.