Since the earth-brick system is closed (no work by the external forces is done), the total energy is conserved
Hence