Heat 1 tsp oil in a heavy-bottom pan and add 2 tsp of garlic and 1 tsp red pepper flakes. Saute for a few seconds, then add the lentils. Stir well, then add 3 cups of water.
Bring to a boil, then place a lid on it and cook until the lentils are really tender, about 30 minutes. (If you have a pressure cooker, you can prepare the lentils in it and cut down on the time required).
Stir in salt and pepper and reserve.
In another pan, heat 1 tsp oil and add the onions and sugar. Cook on a medium flame, stirring, until the onions are caramelized and golden-brown, about 10 minutes. Remove the onions and reserve.
In the same pan, heat the remaining oil and add the remaining 2 tsp of garlic and the remaining red pepper flakes.
Add the mushrooms. Stir-fry the mushrooms until they soften. Add salt and black pepper and garam masala and continue cooking until the mushrooms are cooked but still have a great bite to them.
Set aside a few mushrooms for garnish and mix the dal wth the remaining mushrooms. Bring the mixture to a boil. Check seasoning, mix in fresh coriander leaves and lemon juice.
Top with the mushrooms and caramelized onions. Serve hot with the biryani.