All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
If the dirt that you saw originates from the body, then it is not considered a barrier, so the Ghusl (ritual bath) is valid and sufficient with its presence.
The footnote of Al-Bijermi ‘ala Al-Khateeb reads:
"Al-Isnawi said: "It is conceivable that ablution and Ghusl are valid while a person has something attached to his body that prevents water from reaching it which he can remove, and he is not obliged to repeat the prayer. This is in regard to the dirt that originated from one’s body, which is the sweat that accumulates on it; it does not harm, contrary to the dirt that is due to dust, as mentioned by Al-Baghawi in his Fataawa, and it is a considerable view." [End of quote]
For more benefit that small amount of dirt on the body is excused in ablution and Ghusl, please refer to Fatwa 398425.
For more benefit that dirt from sweat does not invalidate Ghusl, please refer to Fatwa 365659.
Allah Knows best.