Some answers to your questions:
1) Earthworms don't suddenly arrive with rain. What happens is the ground becomes so wet, that they move to the surface. They need to keep their skin moist because they exchange air through that moist skin; this is how they breathe. Because the ground at the surface is usually dry, they will not be seen there. After a rain, it is moist enough (and perhaps the soil deeper becomes so water-logged they risk drowning), so you will see them near the surface.
2) It would depend on the poison that they ingest. Different "poisons" act in different ways to target the species they are intended to target, and to minimize damage to unintended targets. Some are more specific than others. So, unless you're concerned about a specific chemical, I can only answer generally with, "maybe."
3) Their digestive system, relative to the size of their body, is quite large. So, small is a relative term.
4) You cannot tell male from female earthworms because there are not two sexes. All earthworms are hermaphrodites. They have both male and female reproductive organs. If you look at them closely and notice that structure that looks like a wide "collar" about 1/3 of the way down their body, the reproductive organs are contained there. When they reproduce, they will join together in an anti-parallel orientation, so the male and female organs of each are in contact and eggs of each can be fertilized.
5) Yes, earthworms are beneficial to gardens. Their holes aerate the soil, and as they digest larger organic matter, they excrete it in forms more accessible to the plants. A healthy earthworm population is very good for a healthy garden.
6) I'm not sure what you're asking in your last question.
If you want to know more about earthworms, many junior high and high school level biology (and even general science) textbooks or lab manuals go into detail on them because it is an easily available organism for dissection labs. You can find out a lot of the basic information from those sources, such as looking at the parts of their digestive system, and other organs.