I had occasion to do some research into Inverse Condemnation (where property is taken for a public use without compensation, the private property owner may sue in Inverse Condemnation if the condemnor does not initiate a suit in eminent domain, in California and many other States a taking has been expanded to include damage to property without an actual invasion).
I picked up some of the Digests, interesting. Most of the cases are alleged regulatory takings. There are a lot of cases, this seems to be a fruitful business line for attorneys.
My hypothetical is, the government institutes a taking from owner A and stakes the taking over the common boundary between A and B effectively initiating a taking of a strip of B's property. It seems to me B would have a cause of action in Inverse Condemnation. The cases indicate in California the suit has to be brought within 5 years of the physical invasion by the government. B couldn't eject the government but it could demand compensation for the taking. The government, at its option, could remove the trespass.
I haven't found a case directly on point but there are a lot of cases and I don't have the entire California Eminent Domain digest because it is over 8,000 headnotes. Inverse Condemnation is discussed in Part IV under Remedies.