In the novel and the film, the incident takes place in Weed. This is a small town where George and Lennie were formerly working. It is not so different from Soledad, and hints to the reader that the two men have been travelling through many such towns in the California dust bowl, trying to scrape together a life.
We are told that straight after Lennie has touched the girl's dress, the girl complains to the police that she had been raped. Lennie - and George by association - are being pursued by a lynch mob. They hide until they can get away-
So we sit in a irrigation ditch under water all the rest of that day. Got on'y our heads sticking outa water, an' up under the grass that sticks out from the side of the ditch.