The new Bosch Gen4 is smaller, lighter and works completely differently from the earlier Boach PerformanceLine motors. The previous generation had a 1:2.5 gearbox between the crank and the chainring. Every revolution of the crank turned the chainring 2.5 revolutions. This means in order to keep the gear ratios sane, the chainrings are tiny. Unfortunately, this causes several issues. To get the equivalent of a 34T front chainring with the Bosch Gen3, you would have to run a 14t chainring. The chainrings wear out really fast, and being so small causes a bunch of clearance problems with frame design.
The new Bosch Gen4 motor does not have the gear multiplication, so it uses standard cranks and chainrings.
The new Trek Rail has a 625Wh battery as well.
Reviews are just coming in on the Bosch Gen4 motor. All of the usual (paid) suspects say it is great, but time will tell.
Another advantage of the Gen4 is that there are new, and better displays, and they have Bluetooth connectivity so your phone can be used as a controller and stat gatherer.
I have not read whether you can do firmware updates with your phone like you can with the Shimano system. That is another shortcoming of the Bosch Gen3 system, firmware can only be updated by a dealer with the proper software and connector cables.
The Bosch Gen3 system, despite its deficiencies, works great, is extremely reliable, and has been the largest selling high-end mid-drive system for years. It is a little outdated compared to Gen4, Shimano, Brose, and the newer Yamaha motors.
Honestly, if the older bike is not significantly discounted, I would go with the newer system.