We investigate the azimuthal asymmetries such as cos2ϕT and Sivers symmetry for J/ψ and π± production in electron-proton scattering, focusing on scenarios where the J/ψ and the pion are produced in an almost back-to-back configuration. The electron is unpolarized, while the proton can be unpolarized or transversely polarized. For the J/ψ formation, we use nonrelativistic QCD (NRQCD), while π± is formed due to parton fragmentation. In this kinematics, we utilize the transverse momentum-dependent factorization framework to calculate the cross sections and asymmetries. We consider both quark and gluon-initiated processes and show that the gluon contribution dominates. In this work, we used the generalized parton model (GPM) for the transverse momentum distribution (TMD) parametrizations and did not consider the effect of TMD evolution. We provide numerical estimates of the upper bounds on the azimuthal asymmetries, as well as employ a Gaussian parametrization for the gluon TMDs, within the kinematical region accessible by the upcoming Electron-Ion Collider (EIC). Published by the American Physical Society 2024