Mari,
There is no such limit at the Gateway level. But keep in mind that there might be various timeouts like sql / http / RFC at various server levels. (ECC/ Gateway / web dispatcher), which might stop you from doing that.
But I do not see any practical scenario for fetching 25,000 records at a time. If it is UI5, you have to use lazy loading feature (pagination). Why do you need to fetch so many records at a time?
Regards
Krishna