Ellerman bombs (EBs) and Ultraviolet (UV) bursts are common brightening phenomena which are usually generated in the low solar atmosphere of emerging flux regions. In this paper, we have investigated the emergence of an initial un-twisted magnetic flux rope based on three-dimensional (3D) magneto-hydrodynamic (MHD) simulations. The EB-like and UV burst-like activities successively appear in the U-shaped part of the undulating magnetic fields triggered by Parker Instability. The EB-like activity starts to appear earlier and lasts for about 80 seconds. Six minutes later, a much hotter UV burst-like event starts to appear and lasts for about 60 seconds. Along the direction vertical to the solar surface, both the EB and UV burst start in the low chromosphere, but the UV burst extends to a higher altitude in the up chromosphere. The regions with apparent temperature increase in the EB and UV burst are both located inside the small twisted flux ropes generated in magnetic reconnection processes, which are consistent with the previous 2D simulations that most hot regions are usually located inside the magnetic islands. However, the twisted flux rope corresponding to the EB is only strongly heated after it floats up to an altitude much higher than the reconnection site during that period. Our analyses show that the EB is heated by the shocks driven by the strong horizontal flows at two sides of the U-shaped magnetic fields. The twisted flux rope corresponding to the UV burst is heated by the driven magnetic reconnection process.