There are subtle ways in which Steinbeck give the impression of isolation and loneliness. Here are a few examples.
First, the sixth word of the book is Soledad. It is a name of the town, Soledad, which means solitude in Spanish. This alone sets up the imagery that Lennie and George, who are already lonely, are destined for solitude.
Second, when the men arrive at the ranch, the mood and imagery of solitude is confirmed. The whole environment is built off of separation. There is a men's bunk for the workers. The black man is by himself, because of the color of his skin. The boss of the farm is separated, and so is Curley's wife. They are all together in a sense, but there is profound separation.
Finally, the book outrightly speaks of isolation. Here is a quote:
"Guys like us, that work on ranches, are the loneliest guys in the world. They got no family. They don’t belong no place."