Continuing from the title, did the eunuchs expect no retaliation by He Jin's men? what is the context that makes their actions make sense?
Hope this helps
In short: The eunuchs were facing death and destruction as it was, they were desperate. Killing the leader of their opponents was something of an old play that had worked several times before with the supporters of their opponents folding but circumstances were different now.
Part 1
Long Context
The eunuchs as an institution had been involved in many political coups, to overthrow powerful in-laws. By the time they helped Emperor Huan overthrow the possible regicide Liang Ji in 159 and became major players at court, they had rescued three Emperor's (He, Shun and Huan). The coups would be short affairs, the eunuchs would be acting on behalf of the Emperor and so with that authority, people fell in behind them. The General-in-Chiefs usually didn't bother gaining the support of the capital troops and their positions would collapse as troops didn't put up a fight. The gentry would see some punished who were deemed too complicit, in fall of Liang Ji's case this caused difficulty filling posts, but the Emperors would need the gentry so it never went too far.
In 168 Emperor Huan died and a young Emperor Ling was selected for the throne. The Dou were the Dowager family and the General-in-Chief Dou Wu allied with Grand Tutor and known eunuch opponent Chen Fan. They planned to get rid of the eunuchs but their coup of 24th October would be poorly planned, poorly executed (unless the idea was to show a lesson on how not to do a coup). The eunuchs got the young Emperor Ling behind them and used the perhaps confused visiting general Zhang Huan to act as military support. The dithering plotters saw their troops desert and their position collapse.
Initially, the eunuchs withheld from going after more than a few select names but when the Imperial University students started protesting against the regime, the eunuchs persuaded Emperor Ling to charge certain figures with faction and begin the Great Proscription. Many were killed, others fleeing into exile (including some of He Jin's future supporters) and plenty were barred from office until the Turban revolt of 184 saw an easing.
Since 159, the eunuchs and the gentry had played their deadly dance. The gentry complained about the power of the eunuchs, seeing the eunuchs as unnatural who should not hold power and objecting to their getting adopted sons, of their families building big mansions and being local rivals to their long-held power. They accused the eunuchs of corruption and violence while carrying out murders and avoiding office. Sometimes one of their own would get into an Emperor's favour or evidence of eunuch corruption so blatant that some of the eunuchs would fall but the institution remained in favour.
The eunuch's views aren't known, their personalities and the like were not recorded. They were a useful bulwark for Emperors in challenging the power of the gentry families at local and court level. They were not adverse at charging their enemies and forcing them out of the office or indeed getting them killed, some of the charges of corruption and violence may well have been true. Some eunuchs would fall for their crimes but their usefulness and their political skills to outwit their rivals kept them in power, they were ruthless in keeping what they had.
Recent Context
When Emperor Ling died with an unclear choice of which son to go for, the political games began. The He family led by the commanding Dowager He and half-brother He Jin battled to get He's son Bian on the throne, destroying political rivals like the Dong clan and the eunuch commander Jian Shi while allying with the major gentry family the Yuans.
The eunuchs were content with this, they had refused to back Jian Shi's plans and had been allies with the He clan who had needed support against Emperor Ling's anger and against gentry slander.
However He Jin, amidst rumours of being from butcher family and her sister having bribed way into the harem, soon got interest from the likes of Yuan Shao. It had been noted that He Jin as General-in-Chief since the Turbans had worked to win the soldiers over and was popular, the chances of the troops just drifting away as had happened so often was rather less. He Jin had a desire for respectability among the elite and Yuan Shao offered that via his own prestige and by defeating the eunuchs.
Months of political manoeuvring began with the He family split, Dowager He and general He Miao backed the eunuchs and became worried about He Jin's ambitions, what would happen to the throne if the eunuchs were destroyed. He Jin was under pressure from his officers to use his military strength to massacre the eunuchs but he refused, preferring to negotiate for the dismissal of the eunuchs.
As talks stalled, the pressure ramped up as He Jin called in troops from the outside to make a show of strength and the town of Mengjin was set on fire by Ding Yuan (possibly not intended by He Jin) with the fires seen from Luoyang. He Jin also gave investigative posts to two known anti-eunuch figures:
Odds are, the investigations would not have ended with "You know what, I was completely wrong about the eunuchs. We should praise them". Under this double pressure, the Dowager sought to spare them by sacking them. The eunuchs went to see He Jin, Yuan Shao wanted to kill them there and then but He Jin was content if they left the capital.
However, something leaked out from He Jin's camp (I do wonder if Yuan Shao forging orders for the provinces to arrest and investigate eunuch families got discovered) and the eunuchs fled back to the Dowager who took them back in. Talks hadn't worked, surrender had not brought safety.
To me, a much greater mystery is why would He Jin summon Dong Zhuo and forces from the borders to the city if as it turned out forces already there were enough. I never understood what exactly did he expect. I mean, I saw reconstruction of Han palace. It looked like a proper fortress and I could understand if say eunuchs locked themselves in there with some kind of mercenary force which would be difficult to drive out and besiege without overwhelming numbers. But that wasn't the case, and later on Yuan Shao had no problem storming the palace with a token force and killing most of eunuchs.
Calling border troops to come is what doomed both the Han dynasty but also He Jin himself. Once eunuchs found out that forces from Xiliang were coming they hurried with their plans to kill Jin (I hope this might answer your question). However even if successful Jin's plan was ridiculous. In best case scenario where everything goes as planned He Jin would have to make so many concessions to Dong Zhuo as gratitude for service that in the end he would probably make him the most powerful man in the Empire anyway. It would be just a matter of time before Zhuo would probably off He Jin and take over. From He Jin's perspective it makes little sense to do what he did. But who knows, perhaps he thought eunuchs were more powerful than they were.