WDP4B is a passenger variant of WDG4 ( it's not derived from the WDP4). The original WDP4 loco had a 1-Bo-Bo-1 configuration i.e., only 4 powered axles and 2 unpowered axles. This arrangement was causing a lot of wheel slip issues. So, DLW took the WDG4 locomotive which was already a Co-Co type, and changed the gear ratios to make it suitable for passenger operations. This modified loco was named WDP-4B. WDP4-D is just a dual cab version of the WDP-4B with practically no other changes.