Just how would they know those things butted heads in order to attract mates? That seems like an unverifiable scientific wild-ass guess.
I am not sure how scientists have decided on these displays of behavior, but public TV has shown a recent series of various dinosaur finds and combined the search and science with animated displays of dinosaur life and behavior. One of this series was for a head butting species. Naturally it had dominant males butting over who gets the girl, but it also showed young sub-adult males who were ejected from the tribe learning to make friends and live together. Head butting was one of the getting to know you displays shown in the animated videos. In all it was quite a fascinating series if you have any interest in dinos. It included several carnivora, herbivores and even the largest of the herbivores, 60 feet tall with the head erect, and one flying variety.