Investors should shift toward smaller firms, according to UBS.Westend61/Getty Images/Westend61Large caps have consistently led small- and mid-sized companies in recent years.But smaller firms have fared well lately, despite expectations for higher interest rates.UBS shared 40 top small- and mid-cap stocks to buy now.A forgettable multi-year stretch for smaller stocks could end in 2025, researchers at UBS say — even though key risks are looming over the cohort.The S&P 400 and S&P 600 indexes, which track US-based mid- and small-cap stocks, have made little progress in the last few years, at least compared to the better-known S&P 500.Since the start of 2022, mid caps have risen 12.7% and small caps are up just 2.1% while large caps have surged nearly 25%, despite having their worst year since the financial crisis in 2022.