Be careful when transferring the fish from the baking dish to the plate -- flounder is a fragile fish that falls apart easily. The lemons will be tender enough to eat, rind and all.
Heat oven to 400 degrees. Arrange lemons and onions in a 9-by-13-inch Pyrex baking dish. Dot with butter; add wine and 1/4 cup cold water. Sprinkle with chopped thyme; season with salt and pepper. Bake until onions are soft and translucent, about 40 minutes.
Remove baking dish from oven. Arrange fish fillets over lemons and onions. Season fillets with salt and pepper. Scatter fresh thyme sprigs over fish. Baste fish with a little cooking liquid. Bake until fish is just opaque and cooked through, 16 to 18 minutes. Do not overcook. Serve fish with cooked onions and lemons.