Yes, it is allowed to use electronic ID cards when traveling on planes and trains. Under the premise of complying with relevant policies and regulations, electronic ID cards (such as mobile electronic ID cards) can replace traditional paper ID cards. Please follow the regulations of airlines and railway departments for specific operations.