Who would win? First, why would t-rex attack triceratops. Research shows that t-rex would prefer to scavange other kills or feast on animals that had died of disease or old age. If it couldn’t find anything dead it would attack hadrosaurs or sauropods before going for triceratops.
Triceratops’ weapons and defences were : thick skin, sharp beak, large frill, big horns. Its weakness was its neck, which was defended by its frill.
T-rex’s weapons and defences were: Sharp teeth, powerful jaws. The rest of its body was a weakness. Its arms were useless.
When you add it all up, triceratops would win.