The formula for work is:
W = F * d Where W is work, F is Force, and d is distance.
Without doing any math, it can be seen from the equation that work is directly proportional to the force applied and the distance it travels. The homerun hit both traveled more distance and had a grater force applied to it in order to achieve this distance (assuming both baseballs weighed the same). Based on this reasoning, it is valid to conclude that the baseball which was a homerun was the hit that accomplished more work.