Most likely. Yes. It will work. Both manufacturers don’t use proprietary systems such as Bo$ch or $pecialized.
Take a look at how the battery interfaces with the dock of each bike before you try it. You should find that they are the same. Might want to look at the polarity of the batteries first, to be sure they match. Just to be super double sure.