The weight of the car is a force that acts in a vertical direction and points downwards. Work is the product of a force and the displacement caused due to the force in the same direction that it is acting in. As the trailer is moving horizontally, no work is done by the force of 2500 N that is the weight of the car.
Work is done by the force of 20N applied by the car that pulls the trailer along the horizontal road. An assumption has been made that the force acts in a horizontal direction.
The work done in pulling the trailer by the car is 20*8000 Nm = 16000 J = 16 kJ.