I know Railway, Services play as a state in Ranji Trophy. But why Mumbai is considered as an individual team or state though Maharashtra plays in Ranji Trophy?
Maharashtra cricket team doesn't represent the whole Maharashtra state. The cricket team for the city of Pune was named as Maharashtra cricket team. There is an another cricket team named Vidarbha cricket team which is also from the state of Maharashtra.
There are three teams playing from Gujarat state. One of the team named Gujarat cricket team.
The Ranji Trophy is India's domestic cricket competition played between teams representing REGIONAL cricket associations. At the time of its inception in 1934, the current notion of states did not exist. Instead India comprised of various provinces and kingdoms, some of which took part in the Ranji Trophy.
While many of those teams still play in today's Ranji Trophy (Mumbai, formerly Bombay), some of them have evolved (Tamil Nadu, formerly Madras) while some do not feature anymore(like Sind, Southern Punjab etc)