Hi there Gongya Yu
Thanks for using QandA platform
Yes, Route Server needs to be in the same VNet as the ER or VPN Gateway for it to function correctly.
. If ER and RS are not in the same VNet, Route Server won't be able to peer with the ExpressRoute Gateway, may cause routing issues. aso, for your setup with on-premises connectivity through ExpressRoute and routing managed by Route Server to a Network Virtual Appliance (NVA), both ER and RS must reside within the same VNet.
If this helps kindly accept the answer thanks much.