Organic-rich ultratight porous media such as shales have complicated pore types and sizes, dictating their unique fluid transport and storage mechanisms. This paper introduces a diffusion-based binary gas (CH4 and CO2) transport model in such porous media, incorporating key transport and storage mechanisms. Binary gas mixture within the pore volume is divided into two domains: the free-phase and the sorbed-phase, both of which contribute to gas mass transport. Thermodynamic properties of the free phase are determined using the Peng-Robinson equation of state, while a modified extended Langmuir isotherm describes the sorbed phase. The bulk diffusion, Knudsen diffusion, and viscous diffusion are reconciled to describe binary gas transport in the free phase, while the surface diffusion is considered in the sorbed phase. The mass flux is finally related to the effective diffusion coefficient and the free-phase concentration gradient through coupling all transport mechanisms via the equivalent resister network model. The governing equations are solved numerically using a finite difference approach to simulate co-diffusion and counter-diffusion of a binary gas mixture in two nanoporous media, shale and coal.The results reveal that surface diffusion is more pronounced in coal than in shale due to coal's higher adsorption capacity. In co-diffusion cases, both free-phase and sorbed-phase concentrations decrease over time. However, the decline of sorbed-phase concentrations is slower than that of the free-phase. Moreover, CO2 tends to remain adsorbed within the coal matrix due to its stronger adsorption affinity, unlike CH4, which is more likely to flow out. In counter-diffusion cases, injected CO2 first accumulates near the fracture region and then diffuses further into the matrix. Despite shale's pore volume being twice that of coal, similar amounts of CO2 are injected, which can be attributed to coal's higher CO2 adsorption capacity.