I will fail 1 (or 2) classes this semester as a master's student. Should I forget about PhD applications to schools in US?
If getting a PhD is something you really want to do, I suggest applying. If your failing those classes is truly not a reflection of your abilities or motivation, but - as you said - relating to effects of the pandemic/quarantine, then hopefully the rest of your course grades and other application materials will make up for those two failed courses.
When I applied to PhD programs, my own bit of insecurity came from the fact that I had graduate credits from another university where I didn't receive a degree (it was my first attempt at a PhD and it just wasn't a good fit). I decided to address it in my personal statement. I acknowledged that I attempted my PhD before but quit, explained why, and quickly moved on to explain how it was still a learning experience for me in terms of coursework, gaining teaching experience,and learning more about myself and what I valued/prioritized in a PhD program.
I would suggest you do something similar in your personal statement (if engineering programs require them), and to keep it brief. Acknowledge the failed courses, offer an explanation for why you failed the classes in such a way that they understand that this was an atypical experience for you, and then come back with a statement of some sort that illustrates why - despite what you just shared - you're still a great candidate for their program. None of this should dominate the personal statement, I would keep it to just a few sentences.