2.5G Ethernet will pretty much always be the better choice if actually installing/routing the physical cabling isn't too big a problem. The biggest win will be the reliably less than 1ms latency, which will beat Wifi every time. Next, Ethernet is full duplex (talking in both directions simultaneously), where Wifi is half duplex (only one device can talk at any moment in time). Lastly, Wifi will always be subject to random/variable performance due to interference; it's a lot better on 5GHz and 6GHz (than 2.4GHz), but the external factors still exist.
As long as you use decent quality cabling, Ethernet mostly just works; and is highly reliable / stable / predictable, without external factors in general.