Yes, you can take an electric bicycle on the bus or train.
For Irish Rail services, it is free to bring your bicycle on the mainline train but you are recommended to book in advance to ensure that there is space. On commuter train services, you can bring a bicycle on the train at off-peak times for free. In reality, you will typically be allowed to bring it on during on-peak times too but may be refused if space is limited.
For Bus Éireann services, there is a charge of €10. You may not take a full-size electric bicycle on city bus services.
A fold-up electric bicycle may be brought on any train or bus services at any time for free since it is considered your personal luggage. You may be asked to place it in a carry bag.