For heavy aircraft it is required (and for light, very sensible anyway) that the takeoff be scheduled on being able to handle an engine failure without crashing (for heavy, or without crashing very badly, for a lightie).
SIDs look at AEO, not OEI .. so, if terrain is a problem, the operator's ops engineering folk (or contract organisation) need to have scheduled a get out of jail free card departure (ie OEI escape) procedure to cover the OEI case.
More importantly, unless the gross weight is low enough for the aircraft to meet the SID requirements, the commander must not follow the SID after an engine failure.