Look, this is one of those episodes you have to take as is. The reality is that they could've easily overpowered the Ferengi at numerous points and not had all of the silliness.
I also question whether or not they would've impounded the ship and taken them back to Starfleet as prisoners. Granted, rules weren't really established then, but this was more of an 80's scheme and then off your way once they foiled the scheme. I would argue that they had an obligation to take the ship, weapons, technology, etc or at least taken them apart and seen how they work.
Anyway, just take it as is and it's fun and enjoyable.
I also question whether or not they would've impounded the ship and taken them back to Starfleet as prisoners. Granted, rules weren't really established then, but this was more of an 80's scheme and then off your way once they foiled the scheme. I would argue that they had an obligation to take the ship, weapons, technology, etc or at least taken them apart and seen how they work.
Anyway, just take it as is and it's fun and enjoyable.