If the ships are in the same fleet they are effectively using the same speed, so it would be the slower speed in that case. You could however put them in separate fleets and have the faster ship follow the slower ship, then they would use their faster speed to either hit or avoid being hit in combat.