Rinse the lentils and rice under cold water until the water runs clear. Slice the onions thinly and gather all spices and ingredients.
Heat the vegetable oil in a frying pan over medium heat. Dredge the sliced onions in flour, shaking off excess, then add to the pan. Cook, stirring occasionally, until golden brown and caramelized, about 15-20 minutes. Remove from heat and set aside.
In a large pot, combine lentils and 6 cups vegetable broth or water. Bring to a boil, then reduce to a simmer. Cook about 20 minutes until lentils are tender but not mushy. Drain excess liquid if needed.
Add rinsed basmati rice, olive oil, salt, coriander seeds, cumin seeds (or ground cumin), allspice, cinnamon, turmeric, and black pepper to the pot with lentils. Stir well to combine.
Pour in an additional 4 cups vegetable broth or water and bring to a boil again. Reduce heat to low, cover, and simmer for 15-20 minutes until rice is fluffy and liquid is absorbed.
Gently fold in the caramelized onions, reserving some for garnish. Taste and adjust seasoning as needed.
Spoon Mujadara onto serving platter or plates. Garnish with reserved caramelized onions, chopped cilantro, and lemon wedges. Serve warm.