In this work, rarefaction effect, heat transfer, and drag coefficient for gas flow around a square cylinder in transition flow regime are numerically studied using unified gas kinetic scheme (UGKS). To reduce computational cost, a mirror symmetry boundary treatment for UGKS is proposed and applied in this study. It is found that: (1) velocity slip is not obvious on upwind and downwind surfaces of square cylinder due to the tangential gas flow being weak in these surfaces; (2) with the increase of local Knudsen number, velocity slip on upper surface always increases, but temperature jump can decrease, which indicates that Knudsen number is not the decisive parameter to characterize temperature jump; (3) the heat transfer between gas and square cylinder enhances with the increase of inflow Knudsen number and cylinder temperature due to the increase of temperature jump and deteriorates with the increase of inflow Mach number on account of gas stagnation; and (4) the drag coefficient increases with the increase of inflow Knudsen number, the decrease of inflow Mach number, and the increase of cylinder temperature. To further predict the variation of average Nusselt number and drag coefficient, correlations for average Nusselt number and drag coefficient with inflow Mach number ranging from 0.05 to 0.3, inflow Knudsen number ranging from 0.1 to 10, and cylinder temperature ranging from 320 K to 380 K are proposed. This research can improve the understanding for mechanisms of gas flow and heat transfer in micro-electromechanical system (MEMS) devices.