A construction firm has been fined after failing to safeguard the public and workers from an unsafe excavation and lifting operation, and not providing adequate welfare facilities for workers on site.