As others have said above, it depends on how you are as an individual, everyone’s different.
I certainly don’t find the role lonely or isolating - unless you’re doing long distance InterCity work, you’re actually in more or less constant contact with folk - passengers, staff, randoms...