Engines don't affect your combat status, and each ship gets one attack "per turn" as such. You don't get extra attacks if you move faster. Also, how is that possible? The enemy has 6 attack vs your no defence, and heavy fighters. You can hit at a theoretical maximum of 1hp per round, per ship. Using base HP's thats 5 turns to take off 30HP - 3 ships, 10hp. In their case, you also have 36hp - 6hp per ship, 6 ships. However, they have 6 attack and can do a theoretical max of 6dmg, each Thats not even half of your enemies single ship HP's. Even halving that, they should easily take 2 to 3 of your ships in the frst fight, and all of them in the 2nd case, they do a theoritical max of 24 per round, which, again halving, is 2 of your 5 ships gone, and you only being able to do 3dmg per round.
Are you sure you have numbers correct? If you did, say, 4 damage or 3 damage, it might pan out with luck. But they do 6x or 8x the damage and fire half as fast, meaning technically, for every 1hp you hit for, they hit for what? 3.5? and the HP totals are fairly similar!
Edit: Also, you attacked more as you had 2x as many ships. Simple maths