In The Hobbit, the trolls' names (Tom, William, and Bert) don't seem to fit their "uncivilized" characters. Why did Tolkien give them those names?
Why he chose those particular names is, so far as I know, unknown. However, it would seem to be a part of The Hobbit's origin as a children's novel, initially unconnected (or barely connected) to the greater legendarium.
Although I don't have any text from Tolkien to confirm it, I would imagine the choice of names was meant to present the trolls as non-threatening1, comic figures; the sort of character you'd expect to run into in a children's fairy-story adventure. In The Annotated Hobbit, Douglas Anderson suggests that Tolkien did this by giving the trolls thick, Cockney accents:
Tolkien presents the Trolls' speech in a comic, lower-class dialect. This linguistic joke shows a perception for language similar to that which Tolkien ascribed to Geoffrey Chaucer in a long paper presented to the Philological Society in Oxford on May 16,1931.
The Annotated Hobbit Chapter 2: "Roast Mutton" Note 15
So it seems plausible that the names were also chosen with this in mind.
Tolkien would come to regret the choice of names later in life, as he reveals in Letter 153, nearly twenty years after The Hobbit was published:
I might not (if The Hobbit had been more carefully written, and my world so much thought about 20 years ago) have used the expression 'poor little blighter', just as I should not have called the troll William.
The Letters of J.R.R. Tolkien 153: To Peter Hastings (Draft). September 1954
1 By which I mean, "presenting no credible threat". Yes, the trolls are threatening to eat the company, but because of the names and the thick Cockney accents, you know they're going to get out of it okay
And why did he give the trolls English language names?
This was supposedly about 6,000 years ago, which would be about 4,000 years before the earliest evidence of Old Germanic, the language ancestral to English.
I didn't know anything about Middle-earth when I first read The Hobbit, but I knew that the date was sometime before history started being recorded in the lands west and east of the Misty Mountains. I guessed that the Misty Mountains might be the Ural Mountains and Wilderland might be east of them.
So Bilbo's home and the land where the trolls lurked might have been somewhere in European Russia. And I knew that Goblins, Trolls, Elves, Dwarves, Hobbits, Dragons, etc. had been mentioned very little, if at all, in recorded history and must have mostly died out before history began to be recorded. The Hobbit must take place hundreds or thousands of years before history began to be recorded in Russia, if my guess was correct. The Hobbit may or may not have happened after history began to be recorded in Egypt or Sumeria, but certainly happened long before history began to be recorded in the lands where Bilbo lived and traveled.
So if I ever thought about the troll names as a kid when The Hobbit was the only Tolkien work that I knew, I would have wondered what the trolls were doing with modern English names in what would become Russia, during an era when the Anglo Saxons were just invading Britain (or hundreds or thousands of years before that). That would have worried me far more than the crudeness and brutality of the trolls with English names, because after a year or two in junior high school it seemed plausible to me that some people with modern English names could be highly uncivilized.
The answer, of course, is the same as for many aspects of The Hobbit which do not fit in with Middle-earth very well. Tolkien was originally just telling stories to his children, and then writing a children's book based on those stories. He didn't have any intention of setting The Hobbit in the same fictional universe as his stories of the Elder days and of Númenor.
And the trolls names fit fairly well with that original goal, although the excellence of The Hobbit as a story, even unconnected with Middle-earth, does make one regret them along with other obvious anachronisms.
But he added in a few names of people and places from his Middle-earth tales. And when he was asked to write a sequel to The Hobbit those scraps of Tolkien lore in The Hobbit naturally suggest to Tolkien that he could write a story which was a sequel both to his stories of Middle-earth and to The Hobbit. And after a decade and a half of writing Lord of the Rings was the result.
And now, of course, there were a number of inconsistencies between his three main works, The Silmarillion, The Hobbit, and Lord of the Rings, and Tolkien spent much of the rest of his life trying to update The Silmarillion and revise The Hobbit, and Lord of the Rings to make the three works more consistent with each other.
The names of the trolls, which some people may think are too civilized, or too modern English, are relics from the original writing of The Hobbit as a simple (though great) children's story unconnected with Middle-earth, and were never edited and replaced for consistency.