Can a layman with a power of attorney lawfully represent someone else in criminal matters?
Not in jurisdictions I am familiar with. A "Power of attorney" is a power to act as an attorney-in-fact, not to act as an attorney-at-law. A layperson practicing law for someone other than herself is usually the unauthorized practice of law and is illegal in most jurisdictions.
It would be permissible if a jurisdiction carved out an exception for a particular kind of case, but they generally don't and are very unlikely to do so in a criminal case. For example, in Washington State "Limited Practice Officers" can assist people with one of a very limited set of civil legal forms that do not need modification.
There may be some exceptions, but they would be more likely to occur before a matter becomes criminal. For example, the accountant who represents a taxpayer before the IRS, or the agent who files a form containing perjury to a federal agency like the post office or homeland security on your behalf.
So it is very unlikely, but if it is important to you you can ask someone familiar with your kind of case in your jurisdiction.
Statutes that forbid non-lawyers from practicing law are generally called unauthorized practice of law statutes. Every state has some type of law that says only lawyers can practice law. However, every state has a slightly different definition of what it means to "practice law" and who is a "lawyer." The punishment for unauthorized practice of law varies from jurisdiction to jurisdiction. Some statutes authorize criminal penalties, while others only authorize civil fines.
It is important to note that unauthorized practice of law statutes also apply to non-lawyers and require them to jump through certain hoops to appear on cases, or take an entirely different bar exam. For example, of I am only licensed to practice in New York and travel to Colorado and represent a client in Denver. I could be violating Colorado law if I don't properly associate with a local attorney.