Preheat the oven to 200C/400F/Gas 6.
Roll the pastry out until 0.25cm/⅛in thickness and cut 24 circles from it, using a 5cm/2in pastry cutter.
Place the circles onto a baking tray and prick all over with a fork.
Bake in the oven for 10-12 minutes, or until cooked through and golden-brown. Remove the pastry from the oven and set aside to cool.
Heat the oil in a frying pan and fry the onions over a low heat for 15 minutes, stirring regularly.
Increase the heat, add the garlic and thyme and cook for a further five minutes.
Add the vinegar and brown sugar and cook, stirring well, until the onions have caramelised. Season to taste with salt and freshly ground black pepper.
To assemble the tartlets, spoon some of the red onion mixture into each pastry circle and top with a piece of brie.