Prepare the ampalaya: Split the ampalaya in half and remove the seeds using a spoon. Flatten the halves on a flat surface and scrape out the white pith inside. Slice the ampalaya into about 1/2 inch thick pieces.
Optional bitterness reduction: If desired, rub the sliced ampalaya with salt and soak in water for at least 15 minutes to reduce bitterness, but note this may reduce nutrition.
Prepare other ingredients: Dice the ripe tomatoes including seeds. Thinly slice the onion lengthwise. Crush and chop the garlic.
Beat the eggs: Beat the eggs and let them come to room temperature before cooking to prevent curdling.
Sauté garlic: Heat oil in a pan. Add garlic just before the oil heats up to cook it slowly and avoid burning. Cook until the garlic browns slightly.
Cook onion and tomato: Add sliced onion and sauté until softened and layers separate. Add diced tomatoes and cook until softened and juices evaporate.
Add ampalaya and season: Add the sliced ampalaya and stir-fry for about 1 minute. Season with salt and ground black pepper, mixing well.
Add eggs: Pour the beaten eggs into the pan and let them settle for a few seconds without stirring. Once the eggs start to set, gently mix them with the rest of the ingredients until cooked through.
Serve: Transfer the stir-fried ampalaya with egg to a serving plate and enjoy.