The James Webb Space Telescope (JWST) will likely provide the first opportunity to detect gases in the the atmospheres of M dwarf terrestrial planets. Due to the nature of the host star’s UV spectrum, biosignature gases may build-up in the atmosphere of M dwarfs to higher abundances than for planets orbiting G dwarfs. However, whether JWST will have the sensitivity to detect and interpret atmospheric biosignatures remains an open question. Here we use coupled 1-D climate-photochemical models with the TRAPPIST-1 stellar spectrum as input to generate a suite of synthetic inhabited planetary environments for TRAPPIST-1 d and e, which are within the star’s optimistic habitable zone and favorable targets for atmospheric characterization with transmission spectroscopy. We simulate Archean-Earth-like environments with either a dominant sulfur- or methane-producing biosphere for clear, cloudy and hazy cases, as well as modern Earth-like environments with photosynthetic oxygen-producing biospheres for clear and cloudy cases. We generate transmission spectra of these environments, and use instrument simulators to assess the likely detectability of different biosignatures with JWST. Our simulations for TRAPPIST-1 d went into runaway and became uninhabitable. For TRAPPIST-1 e, we find that CH4 and CO2 disequilibrium pair may be robustly detectable in ~14 transits for both the methanogen-dominated Archean-like and modern Earth environments that we considered. Biosignatures for the early Earth sulfur biosphere, such as ethane and dimethyl sulfide, produce relatively strong features in our mid-infrared transmission spectra, but the anticipated sensitivity of JWST in this wavelength range is not sufficient to detect these species in a reasonable number of transits. For oxygenic photosynthetic biospheres, biogenically-generated O2 and its photosynthetic byproduct O3 are likely extremely difficult to detect, even after coaddition of all available transits in the nominal JWST mission lifetime. We explored the viability of CH3Cl as an alternative indicator for a photosynthetic biosphere, although global surface fluxes orders of magnitude higher than Earth-like would be needed to detect it. Given the apparent challenge to observing an oxygenic photosynthetic biosphere in transmission, we conclude that the combination of CO2 in the presence of methanogenically-generated CH4 previously proposed for the Archean, may still serve as the most detectable biosignature for a modern Earth-like planet. The CO2/CH4 disequilibrium biosignature therefore has the potential to reveal the presence of a methanogenic biosphere even in the presence of oxygenic photosynthesis, providing a relatively detectable biosignature that may persist over long geological timespans.