The x-wings did mention they thought the station was launching fighters at them, and that's why they attacked. Presumably they'd normally start with 'Hey guy, what's up ?' rather than shooting.
A prison transport seems like the kind of thing that might have air support nearby, and the type of...