This is a very strange use of the word "entertain".
The Cambridge dictionary has this definition:
entertain verb (INVITE) [ I or T ]
to invite someone to your home
and give food and drink to them:
We entertain a lot of people, mainly
business associates of my wife's.
Now that I live on my own, I don't
entertain much.
The Oxford dictionary provides the following in the “fine print”:
Origin Late Middle English: from French entretenir, based on Latin
inter ‘among’ + tenere ‘to hold’. The word originally meant ‘maintain,
continue’, later ‘maintain in a certain condition, treat in a certain
way’, also ‘show hospitality’ (late 15th century).
In your example, the meaning of the word "entertain" is probably a very archaic usage: a direct reference to the origin of the word: “to hold” + “among”.
Using this definition, the following sentence:
A century ago the British arrived in Hindostan and gradually entertained troops in their service and became masters of every state
Would mean:
A century ago the British arrived in [the subcontinent] and gradually brought troops into it and controlled all of its regions.
This is very unusual writing — I assume your example is British and from the early twentieth century, or earlier. American English would never use the word “entertain” this way.