You will most likely need to adjust your chain length going from a 50t x 50 setup to a 52t x 42. This
Chain length Calculator can help predict this. You'll need to input your bike's actual chain stay length and the gearing setups to get the length calculations you need. Going with the Sram 10-42t cassette should avoid any other compatibility problems with your other drive train components.
The gearing change I've outlined is more than a 10% change, it's right at 14%. This will yield a proportional increase in top speed (26.6mph - 23.3 mph)/23.3mph = 14.1% at the same cadence. This isn't the same as saying you can get this 14% increase in speed "at the same effort". It will take more power (effort) to drive the bike faster due to wind resistance and other smaller affects. If your bike motor has excess power then it can provide the needed watts. Otherwise, you, as the rider, will need to add the extra power required at the faster speeds.
Ride On!...and good luck with your upgrade...