Same goes with navy too.
To clarify a bit. To my understanding the "Union Army" was not the official name of the land forces of the United States. But instead a more colloquial term encompassing the combined forces from several different sources that made up the field armies.
You had the small pre-war Regular Army, with only a few thousand men across the country and whose officer corps was split by the war.
Then you had the United States Volunteers, the state regiments raised on a quota system and which made up the bulk of the field forces. Officers could hold rank in both the USV, and the Regulars and in theory with Brevet promotions could have 4 different ranks at once.
And finally the State Militias themselves which in certain instances would serve in the field such as the Gettysburg Campaign, but in general manned things such as POW camps, forts, and internal security.
On official documents United States Army was used. Here is Col. Joshua Chamberlain's citation for the Medal of Honor:
"The President of the United States of America, in the name of Congress, takes pleasure in presenting the Medal of Honor to Colonel Joshua Lawrence Chamberlain, United States Army, for extraordinary heroism on 2 July 1863, while serving with 20th Maine Infantry, in action at Gettysburg, Pennsylvania, for daring heroism and great tenacity in holding his position on the Little Round Top against repeated assaults, and carrying the advance position on Big Round Top."