Without getting into the details of brands, mechboxes, etc, I'd say which to get depends on that you want to do with it. If you want to just go out and shoot people through your iron sights, then an AK is probably your best choice. It's simple and effective and parts from the simplest components to metal bodies and wood kits are generally plentiful.
If you want to add optics, lights, lasers, etc, then a railed M4 would be the best bet. Armalites are the most customizable airsoft guns with parts, brands, options, etc that are limitless.
In terms of performance, neither is better. Comparable quality guns with comparable internals, barrels, velocities, etc will perform the same, give you similar range and accuracy. There is no better gun. There's just a better gun for YOU.