There are several issues here, from what little we know. In no particular order:
1. Is the Pennsylvania business the same business or a legal successor to the company that you signed the agreement with? If it is not, the new company may have no right to sue you, period. Just because the same people are behind the business doesn't give another entity contractual rights. Unless they acquired the rights in some manner, the only rights are those of the entity you signed with.
2. If the new company is not the same business, and the old company that you signed with is no longer in existence, you need to check the laws of the state of its incorporation to determine what rights, if any, a dissolved corporation has. In many cases, a dissolved corporation has the right to maintain a suit in its own name for some period of time after its dissolution. So, even if the company is gone, it still may be able to sue you.
3. Even if the old company has the right to sue, it may not be able to enforce the agreement if it is no longer in business. For example, in Illinois and many other states, a corporation must have a "protectible interest" in order to enforce a restrictive covenant. I would question whether a company that no longer has a business to protect can realistically expect to restrain competition. Again, the fact that the people behind the old company are still in business is irrelevant unless they or their new company legally succeeded to the rights of the old company.
4. If the company is still in business in Pennsylvania but is simply not qualified as a foreign corporation in Maryland, then you need to ask if it is not qualified in Maryland because it is not "doing business" (within the legal meaning of that term) in Maryland. If the company is not required to qualify as a foreign corporation, then it probably has the right to sue in Maryland. For example, if a Pennsylvania company that only does business in Pennsylvania pays for goods from a company in Maryland and the Maryland company fails to deliver the goods, the Maryland courts are not going to throw out a lawsuit filed by the Pennsylvania company just because it is not doing business in Maryland.
5. If the Pennsylvania company is "doing business" in Maryland and has allowed its registration as a foreign company to lapse, then there may be an issue. Most states appear to allow a foreign corporation to bring a suit after reinstating the company's qualification. That would allow the company to first reinstate its foreign corporation status and then bring the action, even if the facts giving rise to the cause of action occurred during the period that the qualification was lapsed. A few states, however, do not allow a corporation to bring an action that arose during the lapse period. I have no idea which category Maryland falls into; perhaps it is one of the minority that would bar the action.
I hope this helps.