Pat the tofu dry and cut it into bite-size cubes.
Warm the oil in a medium pot over medium heat.
Sauté the onion until translucent, about 3 to 4 minutes.
Stir in garlic, ginger, lemongrass paste, and red curry paste; cook 1 minute until fragrant.
Add mushrooms and cook, stirring, until they soften slightly, 2 to 3 minutes.
Pour in vegetable broth and bring to a gentle simmer.
Stir in coconut milk, soy sauce, brown sugar, and red pepper flakes; simmer 3 minutes.
Slide in the tofu and simmer gently for 5 to 7 minutes to warm through.
Fold in the spinach and cook just until wilted, about 1 minute.
Finish with lime juice and black pepper. Ladle into bowls and top with green onions and cilantro.