Usually yes, but there are a few exceptions:
Female Nidoran is in the Field and Monster egg groups, but Nidorina and Nidoqueen are both in Undiscovered.
All baby Pokémon are in Undiscovered, but none of their evolutions are.
* Nincada and Ninjask are in Bug, but Shedinja is in Mineral. Shedinja technically doesn’t “evolve” from Nincada (it appears in your team after Nincada evolves into Ninjask), which might explain this.
Outside of these examples, yes, Pokémon from the same evolutionary line always share an egg group.