Well, first there are different kinds of electric bicycles, then there are different goals, and then there are different reference frames.
Where I live, electric bicycles are only allowed to be electric ASSIST bicycles to be legal. Meaning that the motor isn't allowed to supply any power UNLESS the rider is ALSO pedalling. And the motor must CUT power at and above 23 km/h.
On such a bike, a ride will offer some degree of exercise, particularly if the comparison is to travel by car, bus or train.
But - of course - usually not as much exercise as an unassisted ride.
Then there are electric bicycles that aren't assist bikes, but rather electrical mopeds/scooters. Riding one of those will only offer marginal exercise benefit.