It depends on the selected trading strategy.
Both indicators help determine when the asset is overbought and oversold as well as where its highest and lowest price is located. Both tools, even with ideal settings, provide false signals.
Both usually work in combination with other tools. They are included in the classic technical analysis and remain popular among plenty of traders.
Stochastic oscillators and RSI have benefits and limitations. Choose the indicator according to your trading strategy.