The agriculture sector in Poland could provide 7.8 billion m3 of biogas per year, but this potential would be from dispersed plants of a low capacity. In the current study, a membrane process was investigated for the upgrading biogas to biomethane that conforms to the requirements for grid gas in Poland. It was assumed that such a process is based on membranes made from modified polysulfone or polyimide, available in the market in Air Products PRISM PA1020 and UBE UMS-A5 modules, respectively. The case study has served an agricultural biogas plant in southern Poland, which provides the stream of 5 m3 (STP) h−1 of biogas with a composition of CH4 (52 vol.%), CO2 (46.3 vol.%), N2 (1.6 vol.%) and O2 (0.1 vol.%), after a pretreatment. It was theoretically shown that this is possible to obtain the biomethane stream of at least 96 vol.% of CH4 purity, with the concentration of the other biogas components below their respective thresholds, as required in Poland for gas fuel “E”, with methane recovery of up to 87.5% and 71.6% for polyimide and polysulfone membranes, respectively. The energetic efficiency of the separation process is comparable for both membrane materials, as expressed by power excess index, which reaches up to 51.3 kWth kWel−1 (polyimide) and 40.7 kWth kWel−1 (polysulfone). In turn, the membrane productivity was significantly higher in the case of the polyimide membrane (up to 38.3 kWth m−2) than those based on the polysulfone one (up to 3.13 kWth m−2).