The behaviour of piles in a two-layered soil medium subjected to earthquake ground accelerations are investigated using finite element method. The kinematic and inertial effects on rock socketed piles in a two-layered soil medium are investigated in this study considering the soil properties relevant to Sri Lanka. Hyperbolic nonlinear constitutive model is used for modelling the behaviour of the fully coupled soil medium. The effect of the earthquake was simulated by lateral ground acceleration applied to the bedrock and in this respect two earthquake records measured at a considerable distance away from the epicentre are used in the numerical simulation to take into account large epicentral distance to an anticipated earthquake that might affect Sri Lanka. The validity of the results of the proposed model was established by comparing with the trends observed in similar studies reported in the literature. A detailed parametric study of the kinematic bending moments developed in piles at the layer interface of the two-layered medium is carried out using the developed model. Furthermore, the effects of the inertial forces on the kinematic bending moment developed at the layer interfaces are investigated by varying the pile diameter and the effective masses at the pile head. Moreover, the variation of the bending moments, developed in the pile due to the combined effects of the kinematic and inertial responses of the pile-soil system, with the effective mass at the pile head for different pile diameters is also investigated.