We can't move the water heater. It is located in the garage, which is on one side the our house, the bathroom is on the exact opposite side of the house. The line goes out the hot water tank, down into the crawl space, under the house, and back up. It supplies two bathrooms on the far side of the house, neither of which get hot water quick. The bathroom and kitchen that are right against the garage wall instantly have insanely hot water. The master bath shower is chronically cold as two of the tiled walls (although not the one that holds the plumbing) are exterior walls, which get freaking cold in winter in Alaska*.
The in line tank is about half way between the water heater and the bathrooms under the house in the crawl space. It's not attached to the cold water line going into the house, so I don't think it's an expansion tank. But, it is possible that someone thought, "hey, let's put the expansion tank along the hot water run to the distant bathrooms cause we ran out of room in the garage!" We don't know who installed the tank or why. We just assumed it was to ensure decent pressure to the distant bathrooms.
* our house was built in the 90s and seems to be an attempt at grandeur without a lot of thought or money being put into it. Really, who cares if the bathroom is big enough to count as another bedroom if it's 50 degrees all winter long? Both the plumbing and heating ducts lose all heat before they get to the far side of the house.