As long as the tomatoes haven’t touched the sewage they should be fine. It’s a good idea to wash the tomatoes before eating. Leafy greens which might have been splashed with sewage would be a no go. Root veggies also might be contaminated. If you want to be really careful, cook the tomatoes at least 20 minutes, at boiling temps, should destroy any infectious agents.
Source: I used humanure compost in my garden for for about 20 years. Read up The Humanure Handbook by Jenkins if you want to learn how to do this safely.