Why could Goten and Gohan not resist the Baby controlling them while Trunks was able to?
Trunks has always been stronger than Goten.

When they learned to merge, in the Buu Saga, this was clearly proven, since as Piccolo said, Trunks had to lower their power level, to get equal to Goten, and Goten needed to increase his so that both were in balance and can merge.

So maybe, because of that difference in power, Goten could be controlled, but not Trunks.