Biodiesel are gaining increased public and scientific attention as an alternative to petroleum diesel fuel, driven by factors such as oil price spikes, energy security and environmental concerns. In this study, low grade wastewater sludge originated from wastewater treatment unit of vegetable oil factory as a viable alternative lipid source for biodiesel production was evaluated. The lipid mass fraction of the dry and ash-free sludge was 12.44 ± 0.87%, which mainly comprised of C16–C18 fatty acids. The in-situ transesterification process under subcritical water and methanol conditions was applied as a green pathway to convert lipids into fatty acid methyl esters (FAMEs). The reaction parameters investigated were temperatures (155–215 °C), pressures (5.5–6.5 MPa) and methanol to lipid mass ratios (1:1, 5:1 and 9:1). The highest FAME yield of 92.67 ± 3.23% was obtained at 215 °C, 6.5 MPa and methanol to lipid mass ratio of 5:1. Statistical analysis based on response surface methodology in 3-factor-3-level central composite designed experiments and analysis of variance were applied to examine the relation between input parameters and the response and to locate the optimum condition. Results showed that 98% of the variability in the response could be adequately explained by the second-order polynomial model. The optimum FAME yield (90.37%) was obtained at 215 °C, 6.5 MPa and methanol to lipid mass ratio of 5.12:1. Experimental validation (N = 3) demonstrated satisfactory agreement between the observed and predicted values with an error of at most 3.3%.