Monitoring energy and power quality on board train