Maryland was not invaded. MA and other state militias were simply trying to transit MD to get to DC, as requested by the President, which is entirely constitutional.
With VA seceded, do you have suggestions on how troops from other states were supposed to reach and protect the greatly threatened national capital without crossing MD?
As I recall the Maryland governor said something to the effect of “Go around, idiot! Go around!”
Go down the river instead of overland through the streets of the State's most populous port city.