Short answer. Squeaking eBike brakes are almost always caused by contaminated pads, glazed rotors, or misaligned calipers. Clean the rotor with isopropyl alcohol, sand the pads lightly, and align the caliper. If the squeal persists, replace the pads.
Step by step
Clean the rotor. Wipe with 90 percent isopropyl alcohol on a clean cloth. Never touch the rotor with your bare fingers, oils cause squeal.
Sand the pads. Light sanding with 220 grit sandpaper removes glaze and contaminant layer. Do not do this if the pads are already at wear limit.
Realign the caliper. Squeeze the lever hard while loosening and retightening the caliper mounting bolts. This centers the caliper on the rotor.
Replace pads if squeal persists. Contaminated pads cannot be fully cleaned. If squeal returns after 100 feet of riding, replace them.