Grind celery seeds and caraway seeds in a mortar and pestle; set aside.
Place bratwurst in a large nonstick skillet over medium heat. Mix beer, brown sugar, dry mustard, black pepper, dill weed, and crushed celery and caraway seeds in a bowl, stirring to dissolve brown sugar; pour over the brats. Bring to a boil and reduce heat to low; cover and simmer for 10 minutes.
Uncover and raise heat to medium; boil the sauce until it reduces to a thick, syrupy liquid, about 20 minutes.
Roll brats in the sauce until thoroughly coated. Transfer sausage to a platter and keep warm. Cook and stir onion and sauerkraut in the same skillet to mix in any leftover sauce, 5 to 8 minutes. Transfer sauerkraut mixture to a serving platter and top with cooked bratwurst.