For a city which cannot grow beyond size 6, you can support size 6 rail you can support your population with 12 food per turn,
So if you have rails you need 3 people working irrigated grassland leaving 3 specialists, you can actually get away with 2 working irrigated grassland and 3 specialists at size 5 though, if you are agricultural you may want to skip railing one of the irrigated grass in this scenario.
Before rails and agriculural civ will be able to use 3 irrigated grass to support 3 specialists, however non-aggricultural will be short
Of course there are oprions where an irrigated food bonus allows you to supoort more specialists with fewer tiles worked, irrigared floodplained wheat offer a phenonomal amount of food.
If you can get past six then say working 4 railed irrigated grass would give 18 fpt allowing 5 specialists = 15 beakers toward science or 10gpt.