I suppose that you want to multiply mat1 with each 25*36 matrix in mat2 (36 matrices in total, i.e. mat2.shape[-1]), and finally get 36 results.
The following code may work  :
import torch

b = 256
mat1 = torch.randn(b, 25)
mat2 = torch.randn(25, 36, 36)
mat2_p = mat2.permute(2, 0, 1)  # move the last dimension (matrix number) to the first
res = torch.matmul(mat1, mat2_p)
res = res.permute(1, 2, 0)  # restore

print(res.shape)