When baseboard made of medium-density fiberboard sustains water damage, your best solution is to replace it. However, if the damage is not significant, you can attempt repair. MDF in its undefiled manufactured state is stable and consistent. When it gets wet, it swells and distorts. Swells can be sanded down if the MDF hasn't crumbled or separated to any extent. If the baseboard is profiled -- dips, curves or lines -- replicate the profile using ordinary hand tools.
Sand the baseboard thoroughly with 80-grit sandpaper attached to a hand block. Remove all the paint if damage runs the length of the baseboard. If the damage is integrated in small areas, sand only the area needed.
Slide the sandpaper along the length of the damaged area to remove high spots. Change sandpaper as needed when it fails to remove material.
Mix powdered resin glue with water according to the instructions printed on the manufacturer's package. Fill small separations and cracks with the resin glue using a brush. Allow the glue to dry overnight.
Fill any remaining pits, gouges or seams where the resin glue shrank. Use wood filler and a putty knife. Sand the molding smooth using 100-grit sandpaper when the putty is dry.
Fold a piece of 100-grit sandpaper into thirds. Use it like a knife to replicate lines in the molding. Slide the edge of the sandpaper along existing lines to form new lines. Wrap the sandpaper around dowels to sand shallow curves.
Apply a base coat of sealant to the sanded areas with a brush. Apply two coats of water-resistant paint to match existing paint.