From your source:
“Although a person’s service in the armed forces of a foreign country may not constitute a violation of U.S. law, such action could serve as a predicate act for the relinquishment of U.S. citizenship under 349(a)(3) of the INA [8 U.S.C. 1481(a)(3)] under two circumstances. Section 349(a)(3) provides for loss of U.S. nationality if a U.S national voluntarily and with the intention of relinquishing U.S. nationality enters or serves in the armed forces of a foreign state engaged in hostilities against the United States ...........”
Serving in the Ukraine military is not serving a foreign state engaged in hostilities against the United States.