Understanding the response of ceramics operating in extreme environments is of interest for a variety of applications. Ab initio molecular dynamic simulations have been used to investigate the effect of structure and $B$-site (=Ti, Zr) cation composition of lanthanum-based oxides (La$_2$$B_2$O$_7$) on electronic-excitation-induced amorphization. We find that the amorphous transition in monoclinic layered perovskite La$_2$Ti$_2$O$_7$ occurs for a lower degree of electronic excitation than for cubic pyrochlore La$_2$Zr$_2$O$_7$. While in each case the formation of O$_2$-like molecules drives the structure to an amorphous state, an analysis of the polyhedral connection network reveals that the rotation of TiO$_6$ octahedra in the monoclinic phase can promote such molecule formation, while such octahedral rotation is not possible in the cubic phase. However, once the symmetry of the cubic structure is broken by substituting Ti for Zr, it becomes less resistant to amorphization. A compound made of 50% Ti and 50% Zr (La$_2$TiZrO$_7$) is found to be more resistant in the monoclinic than in the cubic phase, which may be related to the lower bandgap of the cubic phase. These results illustrate the complex interplay of structure and composition that give rise to the radiation resistance of these important functional materials.